Struct bitcoin_scripts::PubkeyScript
source · pub struct PubkeyScript(_);Expand description
A content of scriptPubkey from a transaction output
Implementations§
source§impl PubkeyScript
impl PubkeyScript
sourcepub fn address(&self, network: Network) -> Option<Address>
pub fn address(&self, network: Network) -> Option<Address>
Generates an address matching the script and given network, if possible.
Address generation is not possible for bare bitcoin_scripts and P2PK; in
this case the function returns None.
sourcepub fn witness_version(&self) -> Option<WitnessVersion>
pub fn witness_version(&self) -> Option<WitnessVersion>
Returns witness version of the scriptPubkey, if any
Trait Implementations§
source§impl AsMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl AsMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
source§impl AsRef<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl AsRef<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
source§impl Borrow<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl Borrow<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
source§impl BorrowMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl BorrowMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
source§impl Clone for PubkeyScript
impl Clone for PubkeyScript
source§fn clone(&self) -> PubkeyScript
fn clone(&self) -> PubkeyScript
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 PubkeyScript
impl Debug for PubkeyScript
source§impl Default for PubkeyScript
impl Default for PubkeyScript
source§fn default() -> PubkeyScript
fn default() -> PubkeyScript
Returns the “default value” for a type. Read more
source§impl Deref for PubkeyScript
impl Deref for PubkeyScript
source§impl DerefMut for PubkeyScript
impl DerefMut for PubkeyScript
source§impl Display for PubkeyScript
impl Display for PubkeyScript
source§impl From<AddressCompat> for PubkeyScript
impl From<AddressCompat> for PubkeyScript
source§fn from(compact: AddressCompat) -> Self
fn from(compact: AddressCompat) -> Self
Converts to this type from the input type.
source§impl From<AddressPayload> for PubkeyScript
impl From<AddressPayload> for PubkeyScript
source§fn from(ap: AddressPayload) -> Self
fn from(ap: AddressPayload) -> Self
Converts to this type from the input type.
source§impl From<PubkeyHash> for PubkeyScript
impl From<PubkeyHash> for PubkeyScript
source§fn from(pkh: PubkeyHash) -> Self
fn from(pkh: PubkeyHash) -> Self
Converts to this type from the input type.
source§impl From<PubkeyScript> for Script
impl From<PubkeyScript> for Script
source§fn from(wrapped: PubkeyScript) -> Self
fn from(wrapped: PubkeyScript) -> Self
Converts to this type from the input type.
source§impl From<Script> for PubkeyScript
impl From<Script> for PubkeyScript
source§impl From<WPubkeyHash> for PubkeyScript
impl From<WPubkeyHash> for PubkeyScript
source§fn from(wpkh: WPubkeyHash) -> Self
fn from(wpkh: WPubkeyHash) -> Self
Converts to this type from the input type.
source§impl Hash for PubkeyScript
impl Hash for PubkeyScript
source§impl LowerHex for PubkeyScript
impl LowerHex for PubkeyScript
source§impl Ord for PubkeyScript
impl Ord for PubkeyScript
source§fn cmp(&self, other: &PubkeyScript) -> Ordering
fn cmp(&self, other: &PubkeyScript) -> 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<PubkeyScript> for PubkeyScript
impl PartialEq<PubkeyScript> for PubkeyScript
source§fn eq(&self, other: &PubkeyScript) -> bool
fn eq(&self, other: &PubkeyScript) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<PubkeyScript> for PubkeyScript
impl PartialOrd<PubkeyScript> for PubkeyScript
source§fn partial_cmp(&self, other: &PubkeyScript) -> Option<Ordering>
fn partial_cmp(&self, other: &PubkeyScript) -> 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 moresource§impl Strategy for PubkeyScript
impl Strategy for PubkeyScript
source§impl UpperHex for PubkeyScript
impl UpperHex for PubkeyScript
source§impl Wrapper for PubkeyScript
impl Wrapper for PubkeyScript
source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
source§fn as_inner_mut(&mut self) -> &mut Self::Inner
fn as_inner_mut(&mut self) -> &mut Self::Inner
Returns a mutable reference to the inner representation for the wrapper
type
source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type