pub struct Bip340Sig {
pub sig: Signature,
pub sighash_type: Option<SighashType>,
}
Fields§
§sig: Signature
The underlying ECDSA Signature
sighash_type: Option<SighashType>
The corresponding hash type
Implementations§
Source§impl Bip340Sig
impl Bip340Sig
Sourcepub fn sighash_default(sig: Signature) -> Bip340Sig
pub fn sighash_default(sig: Signature) -> Bip340Sig
Constructs an ECDSA bitcoin signature for [SighashType::All
].
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Bip340Sig, SigError>
pub fn from_bytes(bytes: &[u8]) -> Result<Bip340Sig, SigError>
Deserializes from slice following the standardness rules for
SighashType
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Bip340Sig
impl<'de> Deserialize<'de> for Bip340Sig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Bip340Sig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Bip340Sig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Bip340Sig
impl Serialize for Bip340Sig
Source§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
Source§impl StrictDecode for Bip340Sig
impl StrictDecode for Bip340Sig
fn strict_decode(reader: &mut impl TypedRead) -> Result<Bip340Sig, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for Bip340Sig
impl StrictDumb for Bip340Sig
fn strict_dumb() -> Bip340Sig
Source§impl StrictEncode for Bip340Sig
impl StrictEncode for Bip340Sig
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for Bip340Sig
impl StrictStruct for Bip340Sig
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Bip340Sig
impl StrictType for Bip340Sig
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
impl Copy for Bip340Sig
impl Eq for Bip340Sig
impl StrictProduct for Bip340Sig
impl StructuralPartialEq for Bip340Sig
Auto Trait Implementations§
impl Freeze for Bip340Sig
impl RefUnwindSafe for Bip340Sig
impl Send for Bip340Sig
impl Sync for Bip340Sig
impl Unpin for Bip340Sig
impl UnwindSafe for Bip340Sig
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.