Struct bdk_chain::bitcoin::secp256k1::ffi::XOnlyPublicKey
#[repr(C)]pub struct XOnlyPublicKey(/* private fields */);
Implementations§
§impl XOnlyPublicKey
impl XOnlyPublicKey
pub fn cmp_fast_unstable(&self, other: &XOnlyPublicKey) -> Ordering
pub fn cmp_fast_unstable(&self, other: &XOnlyPublicKey) -> Ordering
Like cmp::Ord
but faster and with no guarantees across library versions.
The inner byte array of Self
is passed across the FFI boundry, as such there are
no guarantees on its layout and it is subject to change across library versions,
even minor versions. For this reason comparison function implementations (e.g.
Ord
, PartialEq
) take measures to ensure the data will remain constant (e.g., by
serializing it to a guaranteed format). This means they may be slow, this function
provides a faster comparison if you know that your types come from the same library
version.
pub fn eq_fast_unstable(&self, other: &XOnlyPublicKey) -> bool
pub fn eq_fast_unstable(&self, other: &XOnlyPublicKey) -> bool
Like cmp::Eq
but faster and with no guarantees across library versions.
The inner byte array of Self
is passed across the FFI boundry, as such there are
no guarantees on its layout and it is subject to change across library versions,
even minor versions. For this reason comparison function implementations (e.g.
Ord
, PartialEq
) take measures to ensure the data will remain constant (e.g., by
serializing it to a guaranteed format). This means they may be slow, this function
provides a faster equality check if you know that your types come from the same
library version.
§impl XOnlyPublicKey
impl XOnlyPublicKey
pub unsafe fn new() -> XOnlyPublicKey
pub unsafe fn new() -> XOnlyPublicKey
Creates an “uninitialized” FFI x-only public key which is zeroed out
§Safety
If you pass this to any FFI functions, except as an out-pointer, the result is likely to be an assertation failure and process termination.
pub unsafe fn from_array_unchecked(data: [u8; 64]) -> XOnlyPublicKey
pub unsafe fn from_array_unchecked(data: [u8; 64]) -> XOnlyPublicKey
Create a new x-only public key usable for the FFI interface from raw bytes
§Safety
Does not check the validity of the underlying representation. If it is invalid the result may be assertation failures (and process aborts) from the underlying library. You should not use this method except with data that you obtained from the FFI interface of the same version of this library.
pub fn underlying_bytes(self) -> [u8; 64]
pub fn underlying_bytes(self) -> [u8; 64]
Returns the underlying FFI opaque representation of the x-only public key
You should not use this unless you really know what you are doing. It is essentially only useful for extending the FFI interface itself.
Trait Implementations§
§impl AsRef<[u8; 64]> for XOnlyPublicKey
impl AsRef<[u8; 64]> for XOnlyPublicKey
§impl CPtr for XOnlyPublicKey
impl CPtr for XOnlyPublicKey
type Target = u8
fn as_c_ptr(&self) -> *const <XOnlyPublicKey as CPtr>::Target
fn as_mut_c_ptr(&mut self) -> *mut <XOnlyPublicKey as CPtr>::Target
§impl Clone for XOnlyPublicKey
impl Clone for XOnlyPublicKey
§fn clone(&self) -> XOnlyPublicKey
fn clone(&self) -> XOnlyPublicKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for XOnlyPublicKey
impl Debug for XOnlyPublicKey
§impl From<XOnlyPublicKey> for XOnlyPublicKey
impl From<XOnlyPublicKey> for XOnlyPublicKey
Creates a new schnorr public key from a FFI x-only public key.
§fn from(pk: XOnlyPublicKey) -> XOnlyPublicKey
fn from(pk: XOnlyPublicKey) -> XOnlyPublicKey
§impl Hash for XOnlyPublicKey
impl Hash for XOnlyPublicKey
§impl<I> Index<I> for XOnlyPublicKey
impl<I> Index<I> for XOnlyPublicKey
§impl Ord for XOnlyPublicKey
impl Ord for XOnlyPublicKey
§impl PartialEq for XOnlyPublicKey
impl PartialEq for XOnlyPublicKey
§fn eq(&self, other: &XOnlyPublicKey) -> bool
fn eq(&self, other: &XOnlyPublicKey) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for XOnlyPublicKey
impl PartialOrd for XOnlyPublicKey
§fn partial_cmp(&self, other: &XOnlyPublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &XOnlyPublicKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more