Add as_mut_ptr to PublicKey
This commit is contained in:
parent
8b4963588a
commit
91c43e7320
|
@ -213,12 +213,18 @@ impl<'de> ::serde::Deserialize<'de> for SecretKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PublicKey {
|
impl PublicKey {
|
||||||
/// Obtains a raw pointer suitable for use with FFI functions
|
/// Obtains a raw const pointer suitable for use with FFI functions
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_ptr(&self) -> *const ffi::PublicKey {
|
pub fn as_ptr(&self) -> *const ffi::PublicKey {
|
||||||
&self.0 as *const _
|
&self.0 as *const _
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Obtains a raw mutable pointer suitable for use with FFI functions
|
||||||
|
#[inline]
|
||||||
|
pub fn as_mut_ptr(&mut self) -> *mut ffi::PublicKey {
|
||||||
|
&mut self.0 as *mut _
|
||||||
|
}
|
||||||
|
|
||||||
/// Creates a new public key from a secret key.
|
/// Creates a new public key from a secret key.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_secret_key<C: Signing>(secp: &Secp256k1<C>,
|
pub fn from_secret_key<C: Signing>(secp: &Secp256k1<C>,
|
||||||
|
|
Loading…
Reference in New Issue