Enum bitcoin::blockdata::transaction::SigHashType [−][src]
pub enum SigHashType { All, None, Single, AllPlusAnyoneCanPay, NonePlusAnyoneCanPay, SinglePlusAnyoneCanPay, }
Hashtype of an input’s signature, encoded in the last byte of the signature Fixed values so they can be casted as integer types for encoding
Variants
0x1: Sign all outputs
0x2: Sign no outputs — anyone can choose the destination
0x3: Sign the output whose index matches this input’s index. If none exists,
sign the hash 0000000000000000000000000000000000000000000000000000000000000001
.
(This rule is probably an unintentional C++ism, but it’s consensus so we have
to follow it.)
0x81: Sign all outputs but only this input
0x82: Sign no outputs and only this input
0x83: Sign one output and only this input (see Single
for what “one output” means)
Implementations
impl SigHashType
[src]
impl SigHashType
[src]pub fn from_u32(n: u32) -> SigHashType
[src]
please use from_u32_consensus
or from_u32_standard
instead
Reads a 4-byte uint32 as a sighash type.
pub fn from_u32_consensus(n: u32) -> SigHashType
[src]
Reads a 4-byte uint32 as a sighash type.
Note: this replicates consensus behaviour, for current standardness rules correctness you probably want Self::from_u32_standard.
pub fn from_u32_standard(n: u32) -> Result<SigHashType, NonStandardSigHashType>
[src]
Read a 4-byte uint32 as a standard sighash type, returning an error if the type is non standard.
pub fn as_u32(self) -> u32
[src]
Converts to a u32
Trait Implementations
impl Clone for SigHashType
[src]
impl Clone for SigHashType
[src]fn clone(&self) -> SigHashType
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Deserialize for SigHashType
[src]
impl Deserialize for SigHashType
[src]impl<'de> Deserialize<'de> for SigHashType
[src]
impl<'de> Deserialize<'de> for SigHashType
[src]fn deserialize<D>(deserializer: D) -> Result<SigHashType, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl From<SigHashType> for u32
[src]
impl From<SigHashType> for u32
[src]fn from(t: SigHashType) -> u32
[src]
impl FromStr for SigHashType
[src]
impl FromStr for SigHashType
[src]impl PartialEq<SigHashType> for SigHashType
[src]
impl PartialEq<SigHashType> for SigHashType
[src]impl<'de> Serialize for SigHashType
[src]
impl<'de> Serialize for SigHashType
[src]