pub enum AddressPayload {
Pkh(PubkeyHash),
Sh(ScriptHash),
Wpkh(WPubkeyHash),
Wsh(WScriptHash),
Tr(OutputPk),
}
Expand description
Internal address content. Consists of serialized hashes or x-only key value.
Variants§
Pkh(PubkeyHash)
P2PKH payload.
Sh(ScriptHash)
P2SH and SegWit nested (proprietary) P2WPKH/WSH-in-P2SH payloads.
Wpkh(WPubkeyHash)
P2WPKH payload.
Wsh(WScriptHash)
P2WSH payload.
Tr(OutputPk)
P2TR payload.
Implementations§
Source§impl AddressPayload
impl AddressPayload
Sourcepub fn into_address(self, network: AddressNetwork) -> Address
pub fn into_address(self, network: AddressNetwork) -> Address
Constructs Address
from the payload.
Sourcepub fn from_script(script: &ScriptPubkey) -> Result<Self, AddressError>
pub fn from_script(script: &ScriptPubkey) -> Result<Self, AddressError>
Constructs payload from a given scriptPubkey
. Fails on future
(post-taproot) witness types with None
.
Sourcepub fn script_pubkey(self) -> ScriptPubkey
pub fn script_pubkey(self) -> ScriptPubkey
Returns script corresponding to the given address.
Sourcepub fn address_type(self) -> AddressType
pub fn address_type(self) -> AddressType
Detects address type.
Trait Implementations§
Source§impl Clone for AddressPayload
impl Clone for AddressPayload
Source§fn clone(&self) -> AddressPayload
fn clone(&self) -> AddressPayload
Returns a copy 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 AddressPayload
impl Debug for AddressPayload
Source§impl From<AddressPayload> for ScriptPubkey
impl From<AddressPayload> for ScriptPubkey
Source§fn from(ap: AddressPayload) -> Self
fn from(ap: AddressPayload) -> Self
Converts to this type from the input type.
Source§impl From<OutputPk> for AddressPayload
impl From<OutputPk> for AddressPayload
Source§impl From<PubkeyHash> for AddressPayload
impl From<PubkeyHash> for AddressPayload
Source§fn from(v: PubkeyHash) -> Self
fn from(v: PubkeyHash) -> Self
Converts to this type from the input type.
Source§impl From<ScriptHash> for AddressPayload
impl From<ScriptHash> for AddressPayload
Source§fn from(v: ScriptHash) -> Self
fn from(v: ScriptHash) -> Self
Converts to this type from the input type.
Source§impl From<WPubkeyHash> for AddressPayload
impl From<WPubkeyHash> for AddressPayload
Source§fn from(v: WPubkeyHash) -> Self
fn from(v: WPubkeyHash) -> Self
Converts to this type from the input type.
Source§impl From<WScriptHash> for AddressPayload
impl From<WScriptHash> for AddressPayload
Source§fn from(v: WScriptHash) -> Self
fn from(v: WScriptHash) -> Self
Converts to this type from the input type.
Source§impl Hash for AddressPayload
impl Hash for AddressPayload
Source§impl Ord for AddressPayload
impl Ord for AddressPayload
Source§fn cmp(&self, other: &AddressPayload) -> Ordering
fn cmp(&self, other: &AddressPayload) -> Ordering
1.21.0 · 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 AddressPayload
impl PartialEq for AddressPayload
Source§impl PartialOrd for AddressPayload
impl PartialOrd for AddressPayload
impl Copy for AddressPayload
impl Eq for AddressPayload
impl StructuralPartialEq for AddressPayload
Auto Trait Implementations§
impl Freeze for AddressPayload
impl RefUnwindSafe for AddressPayload
impl Send for AddressPayload
impl Sync for AddressPayload
impl Unpin for AddressPayload
impl UnwindSafe for AddressPayload
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.