[−][src]Struct earth_codec::Address
Struct containing the bytes and metadata of a Bitcoin Cash address. This is yeilded during decoding or consumed during encoding.
Fields
body: Vec<u8>
Address bytes
scheme: Scheme
Encoding scheme
hash_type: HashType
Hash type
network: Network
Network
Methods
impl Address
[src]
pub fn new(
body: Vec<u8>,
scheme: Scheme,
hash_type: HashType,
network: Network
) -> Self
[src]
body: Vec<u8>,
scheme: Scheme,
hash_type: HashType,
network: Network
) -> Self
Create a new address
pub fn into_body(self) -> Vec<u8>
[src]
Take address bytes
pub fn encode(&self) -> Result<String, AddressError>
[src]
Attempt to convert the raw address bytes to a string
pub fn decode(
addr_str: &str
) -> Result<Self, (CashAddrError, EarthError, Base58Error)>
[src]
addr_str: &str
) -> Result<Self, (CashAddrError, EarthError, Base58Error)>
Attempt to convert an address string into bytes
Trait Implementations
impl<'a> AsRef<[u8]> for Address
[src]
impl Clone for Address
[src]
impl Default for Address
[src]
Creates an empty Address
struct, with the body
bytes the empty vector,
Scheme::Earth
, HashType::Key
, and Network::Main
.
impl PartialEq<Address> for Address
[src]
impl Debug for Address
[src]
impl StructuralPartialEq for Address
[src]
Auto Trait Implementations
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
impl RefUnwindSafe for Address
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self