pub enum SchnorrSighashType {
Default,
All,
None,
Single,
AllPlusAnyoneCanPay,
NonePlusAnyoneCanPay,
SinglePlusAnyoneCanPay,
}
Expand description
Hashtype of an input’s signature, encoded in the last byte of the signature. Fixed values so they can be cast as integer types for encoding.
Variants
Default
0x0: Used when not explicitly specified, defaults to SchnorrSighashType::All
All
0x1: Sign all outputs.
None
0x2: Sign no outputs — anyone can choose the destination.
Single
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
0x81: Sign all outputs but only this input.
NonePlusAnyoneCanPay
0x82: Sign no outputs and only this input.
SinglePlusAnyoneCanPay
0x83: Sign one output and only this input (see Single
for what “one output” means).
Implementations
sourceimpl SchnorrSighashType
impl SchnorrSighashType
sourcepub fn from_u8(hash_ty: u8) -> Result<Self, Error>
👎 Deprecated since 0.29.0: use from_consensus_u8 instead
pub fn from_u8(hash_ty: u8) -> Result<Self, Error>
use from_consensus_u8 instead
Creates a SchnorrSighashType
from raw u8
.
sourcepub fn from_consensus_u8(hash_ty: u8) -> Result<Self, Error>
pub fn from_consensus_u8(hash_ty: u8) -> Result<Self, Error>
Constructs a SchnorrSighashType
from a raw u8
.
Trait Implementations
sourceimpl Clone for SchnorrSighashType
impl Clone for SchnorrSighashType
sourcefn clone(&self) -> SchnorrSighashType
fn clone(&self) -> SchnorrSighashType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SchnorrSighashType
impl Debug for SchnorrSighashType
sourceimpl<'de> Deserialize<'de> for SchnorrSighashType
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for SchnorrSighashType
serde
only.sourcefn deserialize<D>(deserializer: D) -> Result<SchnorrSighashType, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<SchnorrSighashType, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for SchnorrSighashType
impl Display for SchnorrSighashType
sourceimpl From<EcdsaSighashType> for SchnorrSighashType
impl From<EcdsaSighashType> for SchnorrSighashType
sourcefn from(s: EcdsaSighashType) -> Self
fn from(s: EcdsaSighashType) -> Self
Converts to this type from the input type.
sourceimpl From<SchnorrSighashType> for PsbtSighashType
impl From<SchnorrSighashType> for PsbtSighashType
sourcefn from(schnorr_hash_ty: SchnorrSighashType) -> Self
fn from(schnorr_hash_ty: SchnorrSighashType) -> Self
Converts to this type from the input type.
sourceimpl FromStr for SchnorrSighashType
impl FromStr for SchnorrSighashType
sourceimpl Hash for SchnorrSighashType
impl Hash for SchnorrSighashType
sourceimpl Ord for SchnorrSighashType
impl Ord for SchnorrSighashType
sourcefn cmp(&self, other: &SchnorrSighashType) -> Ordering
fn cmp(&self, other: &SchnorrSighashType) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<SchnorrSighashType> for SchnorrSighashType
impl PartialOrd<SchnorrSighashType> for SchnorrSighashType
sourcefn partial_cmp(&self, other: &SchnorrSighashType) -> Option<Ordering>
fn partial_cmp(&self, other: &SchnorrSighashType) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for SchnorrSighashType
Available on crate feature serde
only.
impl Serialize for SchnorrSighashType
serde
only.impl Copy for SchnorrSighashType
impl Eq for SchnorrSighashType
impl StructuralEq for SchnorrSighashType
impl StructuralPartialEq for SchnorrSighashType
Auto Trait Implementations
impl RefUnwindSafe for SchnorrSighashType
impl Send for SchnorrSighashType
impl Sync for SchnorrSighashType
impl Unpin for SchnorrSighashType
impl UnwindSafe for SchnorrSighashType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more