pub enum SegWitInfo {
PreSegWit,
Ambiguous,
SegWit(WitnessVersion),
}Expand description
Defines which witness version may have an address.
The structure is required to support some ambiguity on the witness version
used by some address, since Option<WitnessVersion> can’t cover that
ambiguity (see details in SegWitInfo::Ambiguous description).
Variants§
PreSegWit
P2PKH addresses
Ambiguous
P2SH addresses, which may be pre-segwit, segwit v0 (P2WPK/WSH-in-P2SH), non-taproot segwit v1 wrapped in P2SH, or future segwit versions wrapped in P2SH bitcoin
SegWit(WitnessVersion)
Address has a clearly defined segwit version, i.e. P2WPKH, P2WSH, P2TR or future non-P2SH-wrapped segwit address
Implementations§
Source§impl SegWitInfo
impl SegWitInfo
Sourcepub fn witness_version(self) -> Option<WitnessVersion>
pub fn witness_version(self) -> Option<WitnessVersion>
Detects WitnessVersion used in the current segwit. Returns None
for both pre-segwit and P2SH (ambiguous) addresses.
Trait Implementations§
Source§impl Clone for SegWitInfo
impl Clone for SegWitInfo
Source§fn clone(&self) -> SegWitInfo
fn clone(&self) -> SegWitInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SegWitInfo
impl Debug for SegWitInfo
Source§impl Hash for SegWitInfo
impl Hash for SegWitInfo
Source§impl Ord for SegWitInfo
impl Ord for SegWitInfo
Source§fn cmp(&self, other: &SegWitInfo) -> Ordering
fn cmp(&self, other: &SegWitInfo) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SegWitInfo
impl PartialEq for SegWitInfo
Source§fn eq(&self, other: &SegWitInfo) -> bool
fn eq(&self, other: &SegWitInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SegWitInfo
impl PartialOrd for SegWitInfo
impl Copy for SegWitInfo
impl Eq for SegWitInfo
impl StructuralPartialEq for SegWitInfo
Auto Trait Implementations§
impl Freeze for SegWitInfo
impl RefUnwindSafe for SegWitInfo
impl Send for SegWitInfo
impl Sync for SegWitInfo
impl Unpin for SegWitInfo
impl UnsafeUnpin for SegWitInfo
impl UnwindSafe for SegWitInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more