pub enum AddressType {
P2PKH,
P2SH,
P2WPKH,
P2WSH,
P2TR,
}Expand description
Bitcoin address type
Variants§
P2PKH
Pay-to-Public-Key-Hash (Legacy, starts with 1)
P2SH
Pay-to-Script-Hash (Legacy, starts with 3)
P2WPKH
Pay-to-Witness-Public-Key-Hash (Native SegWit, starts with bc1q)
P2WSH
Pay-to-Witness-Script-Hash (Native SegWit, starts with bc1q)
P2TR
Pay-to-Taproot (Taproot, starts with bc1p)
Implementations§
Source§impl AddressType
impl AddressType
Sourcepub fn is_taproot(&self) -> bool
pub fn is_taproot(&self) -> bool
Check if this is a Taproot address
Sourcepub fn typical_witness_size(&self) -> Option<usize>
pub fn typical_witness_size(&self) -> Option<usize>
Get the typical witness size for this address type
Trait Implementations§
Source§impl Clone for AddressType
impl Clone for AddressType
Source§fn clone(&self) -> AddressType
fn clone(&self) -> AddressType
Returns a duplicate of the value. Read more
1.0.0 · 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 AddressType
impl Debug for AddressType
Source§impl<'de> Deserialize<'de> for AddressType
impl<'de> Deserialize<'de> for AddressType
Source§fn 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
Source§impl PartialEq for AddressType
impl PartialEq for AddressType
Source§impl Serialize for AddressType
impl Serialize for AddressType
impl Copy for AddressType
impl Eq for AddressType
impl StructuralPartialEq for AddressType
Auto Trait Implementations§
impl Freeze for AddressType
impl RefUnwindSafe for AddressType
impl Send for AddressType
impl Sync for AddressType
impl Unpin for AddressType
impl UnwindSafe for AddressType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.