Struct Signature
pub struct Signature {
pub signature: Signature,
pub sighash_type: EcdsaSighashType,
}
Expand description
An ECDSA signature with the corresponding hash type.
Fields§
§signature: Signature
The underlying ECDSA Signature.
sighash_type: EcdsaSighashType
The corresponding hash type.
Implementations§
§impl Signature
impl Signature
pub fn sighash_all(signature: Signature) -> Signature
pub fn sighash_all(signature: Signature) -> Signature
Constructs an ECDSA Bitcoin signature for EcdsaSighashType::All
.
pub fn from_slice(sl: &[u8]) -> Result<Signature, Error>
pub fn from_slice(sl: &[u8]) -> Result<Signature, Error>
Deserializes from slice following the standardness rules for EcdsaSighashType
.
pub fn serialize(&self) -> SerializedSignature
pub fn serialize(&self) -> SerializedSignature
Serializes an ECDSA signature (inner secp256k1 signature in DER format).
This does not perform extra heap allocation.
Trait Implementations§
§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Signature, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Signature, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for Signature
impl Serialize for Signature
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more