Struct secp256k1_sys::Signature
source · #[repr(C)]pub struct Signature(/* private fields */);
Expand description
Library-internal representation of a Secp256k1 signature
Implementations§
source§impl Signature
impl Signature
sourcepub fn cmp_fast_unstable(&self, other: &Self) -> Ordering
pub fn cmp_fast_unstable(&self, other: &Self) -> 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.
sourcepub fn eq_fast_unstable(&self, other: &Self) -> bool
pub fn eq_fast_unstable(&self, other: &Self) -> 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.
source§impl Signature
impl Signature
sourcepub unsafe fn new() -> Self
pub unsafe fn new() -> Self
Creates an “uninitialized” FFI signature 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.
sourcepub unsafe fn from_array_unchecked(data: [c_uchar; 64]) -> Self
pub unsafe fn from_array_unchecked(data: [c_uchar; 64]) -> Self
Create a new signature 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.
sourcepub fn underlying_bytes(self) -> [c_uchar; 64]
pub fn underlying_bytes(self) -> [c_uchar; 64]
Returns the underlying FFI opaque representation of the signature
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§
source§impl Ord for Signature
Available on non-secp256k1_fuzz
only.
impl Ord for Signature
secp256k1_fuzz
only.source§impl PartialOrd for Signature
Available on non-secp256k1_fuzz
only.
impl PartialOrd for Signature
secp256k1_fuzz
only.impl Copy for Signature
impl Eq for Signature
secp256k1_fuzz
only.Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)