pub struct PsbtSighashType { /* private fields */ }
Expand description
A Signature hash type for the corresponding input. As of taproot upgrade, the signature hash
type can be either EcdsaSighashType
or SchnorrSighashType
but it is not possible to know
directly which signature hash type the user is dealing with. Therefore, the user is responsible
for converting to/from PsbtSighashType
from/to the desired signature hash type they need.
Implementations
sourceimpl PsbtSighashType
impl PsbtSighashType
sourcepub fn ecdsa_hash_ty(self) -> Result<EcdsaSighashType, NonStandardSighashType>
pub fn ecdsa_hash_ty(self) -> Result<EcdsaSighashType, NonStandardSighashType>
Returns the EcdsaSighashType
if the PsbtSighashType
can be
converted to one.
sourcepub fn schnorr_hash_ty(self) -> Result<SchnorrSighashType, Error>
pub fn schnorr_hash_ty(self) -> Result<SchnorrSighashType, Error>
Returns the SchnorrSighashType
if the PsbtSighashType
can be
converted to one.
sourcepub fn from_u32(n: u32) -> PsbtSighashType
pub fn from_u32(n: u32) -> PsbtSighashType
Creates a PsbtSighashType
from a raw u32
.
Allows construction of a non-standard or non-valid sighash flag
(EcdsaSighashType
, SchnorrSighashType
respectively).
sourcepub fn to_u32(self) -> u32
pub fn to_u32(self) -> u32
Converts PsbtSighashType
to a raw u32
sighash flag.
No guarantees are made as to the standardness or validity of the returned value.
Trait Implementations
sourceimpl Clone for PsbtSighashType
impl Clone for PsbtSighashType
sourcefn clone(&self) -> PsbtSighashType
fn clone(&self) -> PsbtSighashType
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for PsbtSighashType
impl Debug for PsbtSighashType
sourceimpl<'de> Deserialize<'de> for PsbtSighashType
impl<'de> Deserialize<'de> for PsbtSighashType
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl Deserialize for PsbtSighashType
impl Deserialize for PsbtSighashType
sourcefn deserialize(bytes: &[u8]) -> Result<Self, Error>
fn deserialize(bytes: &[u8]) -> Result<Self, Error>
sourceimpl Display for PsbtSighashType
impl Display for PsbtSighashType
sourceimpl From<EcdsaSighashType> for PsbtSighashType
impl From<EcdsaSighashType> for PsbtSighashType
sourcefn from(ecdsa_hash_ty: EcdsaSighashType) -> Self
fn from(ecdsa_hash_ty: EcdsaSighashType) -> Self
sourceimpl From<SchnorrSighashType> for PsbtSighashType
impl From<SchnorrSighashType> for PsbtSighashType
sourcefn from(schnorr_hash_ty: SchnorrSighashType) -> Self
fn from(schnorr_hash_ty: SchnorrSighashType) -> Self
sourceimpl FromStr for PsbtSighashType
impl FromStr for PsbtSighashType
sourceimpl Hash for PsbtSighashType
impl Hash for PsbtSighashType
sourceimpl Ord for PsbtSighashType
impl Ord for PsbtSighashType
sourcefn cmp(&self, other: &PsbtSighashType) -> Ordering
fn cmp(&self, other: &PsbtSighashType) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Selfwhere
Self: Sized,
const fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourceconst fn min(self, other: Self) -> Selfwhere
Self: Sized,
const fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl PartialEq<PsbtSighashType> for PsbtSighashType
impl PartialEq<PsbtSighashType> for PsbtSighashType
sourcefn eq(&self, other: &PsbtSighashType) -> bool
fn eq(&self, other: &PsbtSighashType) -> bool
sourceimpl PartialOrd<PsbtSighashType> for PsbtSighashType
impl PartialOrd<PsbtSighashType> for PsbtSighashType
sourcefn partial_cmp(&self, other: &PsbtSighashType) -> Option<Ordering>
fn partial_cmp(&self, other: &PsbtSighashType) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more