Struct bitcoin_scripts::PubkeyScript
source · [−]pub struct PubkeyScript(_);
Expand description
A content of scriptPubkey
from a transaction output
Implementations
sourceimpl 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 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
sourceimpl AsMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl AsMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
sourceimpl AsRef<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl AsRef<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
sourceimpl Borrow<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl Borrow<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
sourceimpl BorrowMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
impl BorrowMut<<PubkeyScript as Wrapper>::Inner> for PubkeyScript
sourcefn borrow_mut(&mut self) -> &mut <Self as Wrapper>::Inner
fn borrow_mut(&mut self) -> &mut <Self as Wrapper>::Inner
Mutably borrows from an owned value. Read more
sourceimpl Clone for PubkeyScript
impl Clone for PubkeyScript
sourcefn clone(&self) -> PubkeyScript
fn clone(&self) -> PubkeyScript
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PubkeyScript
impl Debug for PubkeyScript
sourceimpl Default for PubkeyScript
impl Default for PubkeyScript
sourcefn default() -> PubkeyScript
fn default() -> PubkeyScript
Returns the “default value” for a type. Read more
sourceimpl Deref for PubkeyScript
impl Deref for PubkeyScript
sourceimpl DerefMut for PubkeyScript
impl DerefMut for PubkeyScript
sourceimpl Display for PubkeyScript
impl Display for PubkeyScript
sourceimpl From<AddressCompat> for PubkeyScript
impl From<AddressCompat> for PubkeyScript
sourcefn from(compact: AddressCompat) -> Self
fn from(compact: AddressCompat) -> Self
Converts to this type from the input type.
sourceimpl From<AddressPayload> for PubkeyScript
impl From<AddressPayload> for PubkeyScript
sourcefn from(ap: AddressPayload) -> Self
fn from(ap: AddressPayload) -> Self
Converts to this type from the input type.
sourceimpl From<PubkeyHash> for PubkeyScript
impl From<PubkeyHash> for PubkeyScript
sourcefn from(pkh: PubkeyHash) -> Self
fn from(pkh: PubkeyHash) -> Self
Converts to this type from the input type.
sourceimpl From<PubkeyScript> for Script
impl From<PubkeyScript> for Script
sourcefn from(wrapped: PubkeyScript) -> Self
fn from(wrapped: PubkeyScript) -> Self
Converts to this type from the input type.
sourceimpl From<Script> for PubkeyScript
impl From<Script> for PubkeyScript
sourceimpl From<WPubkeyHash> for PubkeyScript
impl From<WPubkeyHash> for PubkeyScript
sourcefn from(wpkh: WPubkeyHash) -> Self
fn from(wpkh: WPubkeyHash) -> Self
Converts to this type from the input type.
sourceimpl Hash for PubkeyScript
impl Hash for PubkeyScript
sourceimpl LowerHex for PubkeyScript
impl LowerHex for PubkeyScript
sourceimpl Ord for PubkeyScript
impl Ord for PubkeyScript
sourceimpl PartialEq<PubkeyScript> for PubkeyScript
impl PartialEq<PubkeyScript> for PubkeyScript
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &PubkeyScript) -> bool
fn ne(&self, other: &PubkeyScript) -> bool
This method tests for !=
.
sourceimpl PartialOrd<PubkeyScript> for PubkeyScript
impl PartialOrd<PubkeyScript> for PubkeyScript
sourcefn partial_cmp(&self, other: &PubkeyScript) -> Option<Ordering>
fn partial_cmp(&self, other: &PubkeyScript) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Strategy for PubkeyScript
impl Strategy for PubkeyScript
sourceimpl UpperHex for PubkeyScript
impl UpperHex for PubkeyScript
sourceimpl Wrapper for PubkeyScript
impl Wrapper for PubkeyScript
sourcefn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
sourcefn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
sourcefn 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 Read more
sourcefn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
impl Eq for PubkeyScript
impl StructuralEq for PubkeyScript
impl StructuralPartialEq for PubkeyScript
Auto Trait Implementations
impl RefUnwindSafe for PubkeyScript
impl Send for PubkeyScript
impl Sync for PubkeyScript
impl Unpin for PubkeyScript
impl UnwindSafe for PubkeyScript
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more