pub struct Signature {
pub sig: Signature,
pub hash_ty: EcdsaSighashType,
}
Expand description
An ECDSA signature with the corresponding hash type.
Fields§
§sig: Signature
The underlying ECDSA Signature
hash_ty: EcdsaSighashType
The corresponding hash type
Implementations§
§impl Signature
impl Signature
pub fn sighash_all(sig: Signature) -> Signature
pub fn sighash_all(sig: 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 StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
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<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.