Enum derive::AddressPayload
source · 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<AddressPayload, AddressError>
pub fn from_script( script: &ScriptPubkey ) -> Result<AddressPayload, 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.
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) -> ScriptPubkey
fn from(ap: AddressPayload) -> ScriptPubkey
Converts to this type from the input type.
source§impl From<OutputPk> for AddressPayload
impl From<OutputPk> for AddressPayload
source§fn from(v: OutputPk) -> AddressPayload
fn from(v: OutputPk) -> AddressPayload
Converts to this type from the input type.
source§impl From<PubkeyHash> for AddressPayload
impl From<PubkeyHash> for AddressPayload
source§fn from(v: PubkeyHash) -> AddressPayload
fn from(v: PubkeyHash) -> AddressPayload
Converts to this type from the input type.
source§impl From<ScriptHash> for AddressPayload
impl From<ScriptHash> for AddressPayload
source§fn from(v: ScriptHash) -> AddressPayload
fn from(v: ScriptHash) -> AddressPayload
Converts to this type from the input type.
source§impl From<WPubkeyHash> for AddressPayload
impl From<WPubkeyHash> for AddressPayload
source§fn from(v: WPubkeyHash) -> AddressPayload
fn from(v: WPubkeyHash) -> AddressPayload
Converts to this type from the input type.
source§impl From<WScriptHash> for AddressPayload
impl From<WScriptHash> for AddressPayload
source§fn from(v: WScriptHash) -> AddressPayload
fn from(v: WScriptHash) -> AddressPayload
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§fn eq(&self, other: &AddressPayload) -> bool
fn eq(&self, other: &AddressPayload) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for AddressPayload
impl PartialOrd for AddressPayload
source§fn partial_cmp(&self, other: &AddressPayload) -> Option<Ordering>
fn partial_cmp(&self, other: &AddressPayload) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl 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<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.