pub enum AddressFormat {
P2pkh,
P2sh,
P2wpkh,
P2wsh,
P2tr,
Future(WitnessVersion),
}
Expand description
Address format
Variants
P2pkh
Pay-to-public key hash
P2sh
Pay-to-script hash
P2wpkh
Pay-to-witness public key hash
P2wsh
Pay-to-witness script pash
P2tr
Pay-to-taproot
Future(WitnessVersion)
Future witness address
Implementations
sourceimpl AddressFormat
impl AddressFormat
sourcepub fn witness_version(self) -> Option<WitnessVersion>
pub fn witness_version(self) -> Option<WitnessVersion>
Returns witness version used by the address format.
Returns None
for pre-SegWit address formats.
Trait Implementations
sourceimpl Clone for AddressFormat
impl Clone for AddressFormat
sourcefn clone(&self) -> AddressFormat
fn clone(&self) -> AddressFormat
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 AddressFormat
impl Debug for AddressFormat
sourceimpl Display for AddressFormat
impl Display for AddressFormat
sourceimpl From<Address> for AddressFormat
impl From<Address> for AddressFormat
sourcefn from(address: Address) -> AddressFormat
fn from(address: Address) -> AddressFormat
Converts to this type from the input type.
sourceimpl From<Payload> for AddressFormat
impl From<Payload> for AddressFormat
sourcefn from(payload: Payload) -> AddressFormat
fn from(payload: Payload) -> AddressFormat
Converts to this type from the input type.
sourceimpl FromStr for AddressFormat
impl FromStr for AddressFormat
type Err = AddressParseError
type Err = AddressParseError
The associated error which can be returned from parsing.
sourcefn from_str(s: &str) -> Result<AddressFormat, <AddressFormat as FromStr>::Err>
fn from_str(s: &str) -> Result<AddressFormat, <AddressFormat as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
sourceimpl Hash for AddressFormat
impl Hash for AddressFormat
sourceimpl Ord for AddressFormat
impl Ord for AddressFormat
sourceimpl PartialEq<AddressFormat> for AddressFormat
impl PartialEq<AddressFormat> for AddressFormat
sourcefn eq(&self, other: &AddressFormat) -> bool
fn eq(&self, other: &AddressFormat) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AddressFormat) -> bool
fn ne(&self, other: &AddressFormat) -> bool
This method tests for !=
.
sourceimpl PartialOrd<AddressFormat> for AddressFormat
impl PartialOrd<AddressFormat> for AddressFormat
sourcefn partial_cmp(&self, other: &AddressFormat) -> Option<Ordering>
fn partial_cmp(&self, other: &AddressFormat) -> 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
impl Copy for AddressFormat
impl Eq for AddressFormat
impl StructuralEq for AddressFormat
impl StructuralPartialEq for AddressFormat
Auto Trait Implementations
impl RefUnwindSafe for AddressFormat
impl Send for AddressFormat
impl Sync for AddressFormat
impl Unpin for AddressFormat
impl UnwindSafe for AddressFormat
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