pub enum BitcoinFormat {
P2PKH,
P2WSH,
P2SH_P2WPKH,
Bech32,
CashAddr,
}Expand description
Represents the format of a Bitcoin address
Variants§
P2PKH
Pay-to-Pubkey Hash, e.g. 1NoZQSmjYHUZMbqLerwmT4xfe8A6mAo8TT
P2WSH
Pay-to-Script Hash, e.g. 34AgLJhwXrvmkZS1o5TrcdeevMt22Nar53 Pay-to-Witness-Script Hash, e.g. bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3
P2SH_P2WPKH
SegWit Pay-to-Witness-Public-Key Hash, e.g. 34AgLJhwXrvmkZS1o5TrcdeevMt22Nar53
Bech32
Bech32, e.g. bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx
CashAddr
CashAddr, e.g. bitcoincash:qpkxa3xypl6rfp4nzewh9xrqnv90n2yxrcr0pmwas4
Implementations§
Source§impl BitcoinFormat
impl BitcoinFormat
Sourcepub fn from_address_prefix(prefix: Prefix) -> Result<Self, AddressError>
pub fn from_address_prefix(prefix: Prefix) -> Result<Self, AddressError>
Returns the format of the given address prefix.
Trait Implementations§
Source§impl Clone for BitcoinFormat
impl Clone for BitcoinFormat
Source§fn clone(&self) -> BitcoinFormat
fn clone(&self) -> BitcoinFormat
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 BitcoinFormat
impl Debug for BitcoinFormat
Source§impl Display for BitcoinFormat
impl Display for BitcoinFormat
Source§impl FromStr for BitcoinFormat
impl FromStr for BitcoinFormat
Source§impl Hash for BitcoinFormat
impl Hash for BitcoinFormat
Source§impl Ord for BitcoinFormat
impl Ord for BitcoinFormat
Source§fn cmp(&self, other: &BitcoinFormat) -> Ordering
fn cmp(&self, other: &BitcoinFormat) -> 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 for BitcoinFormat
impl PartialEq for BitcoinFormat
Source§impl PartialOrd for BitcoinFormat
impl PartialOrd for BitcoinFormat
Source§impl Serialize for BitcoinFormat
impl Serialize for BitcoinFormat
impl Eq for BitcoinFormat
impl Format for BitcoinFormat
impl StructuralPartialEq for BitcoinFormat
Auto Trait Implementations§
impl Freeze for BitcoinFormat
impl RefUnwindSafe for BitcoinFormat
impl Send for BitcoinFormat
impl Sync for BitcoinFormat
impl Unpin for BitcoinFormat
impl UnwindSafe for BitcoinFormat
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)