Enum crypto_addr::AddressOptions
source · #[non_exhaustive]
pub enum AddressOptions {
Bitcoin,
BitcoinCash(Option<String>),
Litecoin,
Dogecoin,
Dash,
BitcoinGold,
Europecoin,
Ripple,
Peercoin,
}Expand description
Options for generating addresses from public keys.
Specifies how a public key should be formatted into an address. Unit-like variants merely specify the blockchain network for which the address is intended to be used. No further information is needed for unit-like variants because this crate only supports one way to format the public key into an address string for that blockchain network.
Non-unit-like variants specify a blockchain network, but also contain additional user options that further specify how the address should be formatted.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bitcoin
Bitcoin mainnet.
BitcoinCash(Option<String>)
Bitcoin cash mainnet. Inner value is the human-readable prefix to use in the address. If it
is Some, the contained String will be used as the prefix to calculate with the cashaddr
string with and it will be included in the cashaddr. If it is None, "bitcoincash" will
be used as the prefix, but it will be omitted from the cashaddr as it is implied.
Litecoin
Litecoin mainnet.
Dogecoin
Dogecoin mainnet.
Dash
Dash mainnet.
BitcoinGold
Bitcoin Gold mainnet
Europecoin
Europecoin mainnet
Ripple
Ripple mainnet
Peercoin
Peercoin mainnet
Implementations§
source§impl AddressOptions
impl AddressOptions
sourcepub fn address_prefix(&self) -> u8
pub fn address_prefix(&self) -> u8
get the address’s prefix byte if it exists
sourcepub fn network_name(&self) -> String
pub fn network_name(&self) -> String
Get the name of the network associated with these options
Trait Implementations§
source§impl Clone for AddressOptions
impl Clone for AddressOptions
source§fn clone(&self) -> AddressOptions
fn clone(&self) -> AddressOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for AddressOptions
impl Debug for AddressOptions
source§impl Default for AddressOptions
impl Default for AddressOptions
source§fn default() -> AddressOptions
fn default() -> AddressOptions
source§impl Display for AddressOptions
impl Display for AddressOptions
source§impl From<&AddressOptions> for WIFOptions
impl From<&AddressOptions> for WIFOptions
source§fn from(opts: &AddressOptions) -> Self
fn from(opts: &AddressOptions) -> Self
Obtain a WIFOptions using the same blockchain network as an AddressOptions
source§impl FromStr for AddressOptions
impl FromStr for AddressOptions
source§impl PartialEq<AddressOptions> for AddressOptions
impl PartialEq<AddressOptions> for AddressOptions
source§fn eq(&self, other: &AddressOptions) -> bool
fn eq(&self, other: &AddressOptions) -> bool
self and other values to be equal, and is used
by ==.