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
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 PsbtSighashType
impl Debug for PsbtSighashType
sourceimpl Deserialize for PsbtSighashType
impl Deserialize 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>,
Deserialize this value from the given Serde deserializer. Read more
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
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 PsbtSighashType
impl FromStr for PsbtSighashType
sourceimpl Hash for PsbtSighashType
impl Hash for PsbtSighashType
sourceimpl Ord for PsbtSighashType
impl Ord for PsbtSighashType
sourceimpl PartialEq<PsbtSighashType> for PsbtSighashType
impl PartialEq<PsbtSighashType> for PsbtSighashType
sourcefn eq(&self, other: &PsbtSighashType) -> bool
fn eq(&self, other: &PsbtSighashType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PsbtSighashType) -> bool
fn ne(&self, other: &PsbtSighashType) -> bool
This method tests for !=
.
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>
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 PsbtSighashType
impl Serialize for PsbtSighashType
sourceimpl Serialize for PsbtSighashType
impl Serialize for PsbtSighashType
impl Copy for PsbtSighashType
impl Eq for PsbtSighashType
impl StructuralEq for PsbtSighashType
impl StructuralPartialEq for PsbtSighashType
Auto Trait Implementations
impl RefUnwindSafe for PsbtSighashType
impl Send for PsbtSighashType
impl Sync for PsbtSighashType
impl Unpin for PsbtSighashType
impl UnwindSafe for PsbtSighashType
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more