pub struct AddressCompat {
pub inner: AddressPayload,
pub testnet: bool,
}
Expand description
See also bitcoin::Address
as a non-copy alternative supporting
future witness program versions
Fields
inner: AddressPayload
Address payload (see AddressPayload
).
testnet: bool
Whether address is a part of one of bitcoin testnets
Implementations
sourceimpl AddressCompat
impl AddressCompat
sourcepub fn from_script(
script: &PubkeyScript,
network: Network
) -> Option<AddressCompat>
pub fn from_script(
script: &PubkeyScript,
network: Network
) -> Option<AddressCompat>
Constructs compatible address for a given scriptPubkey
.
Returns None
if the uncompressed key is provided or scriptPubkey
can’t be represented as an address.
Trait Implementations
sourceimpl Clone for AddressCompat
impl Clone for AddressCompat
sourcefn clone(&self) -> AddressCompat
fn clone(&self) -> AddressCompat
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 AddressCompat
impl Debug for AddressCompat
sourceimpl Display for AddressCompat
impl Display for AddressCompat
sourceimpl From<AddressCompat> for PubkeyScript
impl From<AddressCompat> for PubkeyScript
sourcefn from(payload: AddressCompat) -> PubkeyScript
fn from(payload: AddressCompat) -> PubkeyScript
Converts to this type from the input type.
sourceimpl FromStr for AddressCompat
impl FromStr for AddressCompat
sourceimpl Hash for AddressCompat
impl Hash for AddressCompat
sourceimpl Ord for AddressCompat
impl Ord for AddressCompat
sourceimpl PartialEq<AddressCompat> for AddressCompat
impl PartialEq<AddressCompat> for AddressCompat
sourcefn eq(&self, other: &AddressCompat) -> bool
fn eq(&self, other: &AddressCompat) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AddressCompat) -> bool
fn ne(&self, other: &AddressCompat) -> bool
This method tests for !=
.
sourceimpl PartialOrd<AddressCompat> for AddressCompat
impl PartialOrd<AddressCompat> for AddressCompat
sourcefn partial_cmp(&self, other: &AddressCompat) -> Option<Ordering>
fn partial_cmp(&self, other: &AddressCompat) -> 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 StrictDecode for AddressCompat
impl StrictDecode for AddressCompat
sourcefn strict_decode<D>(d: D) -> Result<AddressCompat, Error> where
D: Read,
fn strict_decode<D>(d: D) -> Result<AddressCompat, Error> where
D: Read,
Decode with the given std::io::Read
instance; must either
construct an instance or return implementation-specific error type. Read more
sourcefn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
Tries to deserialize byte array into the current type using
StrictDecode::strict_decode
Read more
sourceimpl StrictEncode for AddressCompat
impl StrictEncode for AddressCompat
sourcefn strict_encode<E>(&self, e: E) -> Result<usize, Error> where
E: Write,
fn strict_encode<E>(&self, e: E) -> Result<usize, Error> where
E: Write,
Encode with the given std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type. Read more
sourcefn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
Serializes data as a byte array using StrictEncode::strict_encode
function Read more
sourceimpl TryFrom<Address> for AddressCompat
impl TryFrom<Address> for AddressCompat
impl Copy for AddressCompat
impl Eq for AddressCompat
impl StructuralEq for AddressCompat
impl StructuralPartialEq for AddressCompat
Auto Trait Implementations
impl RefUnwindSafe for AddressCompat
impl Send for AddressCompat
impl Sync for AddressCompat
impl Unpin for AddressCompat
impl UnwindSafe for AddressCompat
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more