pub struct Address {
    pub payload: AddressPayload,
    pub network: AddressNetwork,
}Fields§
§payload: AddressPayloadAddress payload (see AddressPayload).
network: AddressNetworkA type of the network used by the address
Implementations§
Source§impl Address
 
impl Address
pub fn new(payload: AddressPayload, network: AddressNetwork) -> Address
Sourcepub fn with(
    script: &ScriptPubkey,
    network: impl Into<AddressNetwork>,
) -> Result<Address, AddressError>
 
pub fn with( script: &ScriptPubkey, network: impl Into<AddressNetwork>, ) -> Result<Address, AddressError>
Constructs compatible address for a given scriptPubkey.
Returns None if the uncompressed key is provided or scriptPubkey
can’t be represented as an address.
Sourcepub fn script_pubkey(self) -> ScriptPubkey
 
pub fn script_pubkey(self) -> ScriptPubkey
Returns script corresponding to the given address.
Sourcepub fn is_testnet(self) -> bool
 
pub fn is_testnet(self) -> bool
Returns if the address is testnet-, signet- or regtest-specific.
Sourcepub fn address_type(self) -> AddressType
 
pub fn address_type(self) -> AddressType
Detects address type.
Trait Implementations§
Source§impl Ord for Address
 
impl Ord for Address
Source§impl PartialOrd for Address
 
impl PartialOrd for Address
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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.