pub struct SighashType {
pub flag: SighashFlag,
pub anyone_can_pay: bool,
}
Fields§
§flag: SighashFlag
§anyone_can_pay: bool
Implementations§
Source§impl SighashType
impl SighashType
pub const fn all() -> SighashType
pub const fn none() -> SighashType
pub const fn single() -> SighashType
pub const fn all_anyone_can_pay() -> SighashType
pub const fn none_anyone_can_pay() -> SighashType
pub const fn single_anyone_can_pay() -> SighashType
Sourcepub fn from_consensus_u32(n: u32) -> SighashType
pub fn from_consensus_u32(n: u32) -> SighashType
Creates a SighashType
from a raw u32
.
Note: this replicates consensus behaviour, for current standardness
rules correctness you probably want Self::from_standard_u32
.
This might cause unexpected behavior because it does not roundtrip. That
is, LegacySighashType::from_consensus(n) as u32 != n
for
non-standard values of n
. While verifying signatures, the user
should retain the n
and use it compute the signature hash message.
Sourcepub fn from_standard_u32(n: u32) -> Result<SighashType, NonStandardValue<u32>>
pub fn from_standard_u32(n: u32) -> Result<SighashType, NonStandardValue<u32>>
Sourcepub const fn into_consensus_u32(self) -> u32
pub const fn into_consensus_u32(self) -> u32
Converts SighashType
to a u32
sighash flag.
The returned value is guaranteed to be a valid according to standardness rules.
Sourcepub const fn to_consensus_u32(&self) -> u32
pub const fn to_consensus_u32(&self) -> u32
Converts SighashType
to a u32
sighash flag.
The returned value is guaranteed to be a valid according to standardness rules.
pub const fn into_consensus_u8(self) -> u8
pub const fn to_consensus_u8(self) -> u8
Trait Implementations§
Source§impl Clone for SighashType
impl Clone for SighashType
Source§fn clone(&self) -> SighashType
fn clone(&self) -> SighashType
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 SighashType
impl Debug for SighashType
Source§impl Default for SighashType
impl Default for SighashType
Source§fn default() -> SighashType
fn default() -> SighashType
Returns the “default value” for a type. Read more
Source§impl Display for SighashType
impl Display for SighashType
Source§impl Hash for SighashType
impl Hash for SighashType
Source§impl PartialEq for SighashType
impl PartialEq for SighashType
Source§impl StrictDecode for SighashType
impl StrictDecode for SighashType
fn strict_decode( reader: &mut impl TypedRead, ) -> Result<SighashType, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for SighashType
impl StrictEncode for SighashType
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 SighashType
impl StrictStruct for SighashType
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for SighashType
impl StrictType for SighashType
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
impl Copy for SighashType
impl Eq for SighashType
impl StrictProduct for SighashType
impl StructuralPartialEq for SighashType
Auto Trait Implementations§
impl Freeze for SighashType
impl RefUnwindSafe for SighashType
impl Send for SighashType
impl Sync for SighashType
impl Unpin for SighashType
impl UnwindSafe for SighashType
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.