Struct nostr::prelude::SchnorrSig
source · pub struct SchnorrSig {
pub sig: Signature,
pub hash_ty: SchnorrSighashType,
}Expand description
A BIP340-341 serialized schnorr signature with the corresponding hash type.
Fields§
§sig: SignatureThe underlying schnorr signature
hash_ty: SchnorrSighashTypeThe corresponding hash type
Implementations§
source§impl SchnorrSig
impl SchnorrSig
sourcepub fn from_slice(sl: &[u8]) -> Result<SchnorrSig, SchnorrSigError>
pub fn from_slice(sl: &[u8]) -> Result<SchnorrSig, SchnorrSigError>
Deserialize from slice
Trait Implementations§
source§impl Clone for SchnorrSig
impl Clone for SchnorrSig
source§fn clone(&self) -> SchnorrSig
fn clone(&self) -> SchnorrSig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for SchnorrSig
impl Debug for SchnorrSig
source§impl Deserialize for SchnorrSig
impl Deserialize for SchnorrSig
source§fn deserialize(bytes: &[u8]) -> Result<SchnorrSig, Error>
fn deserialize(bytes: &[u8]) -> Result<SchnorrSig, Error>
Deserialize a value from raw data.
source§impl Hash for SchnorrSig
impl Hash for SchnorrSig
source§impl Ord for SchnorrSig
impl Ord for SchnorrSig
source§fn cmp(&self, other: &SchnorrSig) -> Ordering
fn cmp(&self, other: &SchnorrSig) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<SchnorrSig> for SchnorrSig
impl PartialEq<SchnorrSig> for SchnorrSig
source§fn eq(&self, other: &SchnorrSig) -> bool
fn eq(&self, other: &SchnorrSig) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<SchnorrSig> for SchnorrSig
impl PartialOrd<SchnorrSig> for SchnorrSig
source§fn partial_cmp(&self, other: &SchnorrSig) -> Option<Ordering>
fn partial_cmp(&self, other: &SchnorrSig) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for SchnorrSig
impl Serialize for SchnorrSig
impl Copy for SchnorrSig
impl Eq for SchnorrSig
impl StructuralEq for SchnorrSig
impl StructuralPartialEq for SchnorrSig
Auto Trait Implementations§
impl RefUnwindSafe for SchnorrSig
impl Send for SchnorrSig
impl Sync for SchnorrSig
impl Unpin for SchnorrSig
impl UnwindSafe for SchnorrSig
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.