pub enum SigHashType {
    All = 1,
    None = 2,
    Single = 3,
    AllPlusAnyoneCanPay = 129,
    NonePlusAnyoneCanPay = 130,
    SinglePlusAnyoneCanPay = 131,
}
Expand description

Hashtype of a transaction, encoded in the last byte of a signature Fixed values so they can be casted as integer types for encoding

Variants§

§

All = 1

0x1: Sign all outputs

§

None = 2

0x2: Sign no outputs — anyone can choose the destination

§

Single = 3

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.)

§

AllPlusAnyoneCanPay = 129

0x81: Sign all outputs but only this input

§

NonePlusAnyoneCanPay = 130

0x82: Sign no outputs and only this input

§

SinglePlusAnyoneCanPay = 131

0x83: Sign one output and only this input (see Single for what “one output” means)

Implementations§

source§

impl SigHashType

source

pub fn from_u32(n: u32) -> SigHashType

Reads a 4-byte uint32 as a sighash type

source

pub fn as_u32(self) -> u32

Converts to a u32

Trait Implementations§

source§

impl Clone for SigHashType

source§

fn clone(&self) -> SigHashType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SigHashType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deserialize for SigHashType

source§

fn deserialize(bytes: &[u8]) -> Result<Self, Error>

Deserialize a value from raw data.
source§

impl PartialEq for SigHashType

source§

fn eq(&self, other: &SigHashType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for SigHashType

source§

fn serialize(&self) -> Vec<u8>

Serialize a value as raw data.
source§

impl Copy for SigHashType

source§

impl Eq for SigHashType

source§

impl StructuralEq for SigHashType

source§

impl StructuralPartialEq for SigHashType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.