Struct chain_addr::AddressReadable
source · pub struct AddressReadable(pub(crate) String);
Expand description
A valid address in a human readable format
Tuple Fields§
§0: String
Implementations§
source§impl AddressReadable
impl AddressReadable
pub fn as_string(&self) -> &str
pub fn get_prefix(&self) -> String
sourcepub fn from_string(expected_prefix: &str, s: &str) -> Result<Self, Error>
pub fn from_string(expected_prefix: &str, s: &str) -> Result<Self, Error>
Validate from a String to create a valid AddressReadable
pub fn from_str_anyprefix(s: &str) -> Result<Self, Error>
pub fn from_string_anyprefix(s: &str) -> Result<Self, Error>
sourcepub fn from_address(prefix: &str, addr: &Address) -> Self
pub fn from_address(prefix: &str, addr: &Address) -> Self
Create a new AddressReadable from an encoded address
sourcepub fn to_address(&self) -> Address
pub fn to_address(&self) -> Address
Convert a valid AddressReadable to an decoded address
Trait Implementations§
source§impl Arbitrary for AddressReadable
impl Arbitrary for AddressReadable
source§impl Clone for AddressReadable
impl Clone for AddressReadable
source§fn clone(&self) -> AddressReadable
fn clone(&self) -> AddressReadable
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 AddressReadable
impl Debug for AddressReadable
source§impl Display for AddressReadable
impl Display for AddressReadable
source§impl FromStr for AddressReadable
impl FromStr for AddressReadable
source§impl PartialEq<AddressReadable> for AddressReadable
impl PartialEq<AddressReadable> for AddressReadable
source§fn eq(&self, other: &AddressReadable) -> bool
fn eq(&self, other: &AddressReadable) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for AddressReadable
impl StructuralEq for AddressReadable
impl StructuralPartialEq for AddressReadable
Auto Trait Implementations§
impl RefUnwindSafe for AddressReadable
impl Send for AddressReadable
impl Sync for AddressReadable
impl Unpin for AddressReadable
impl UnwindSafe for AddressReadable
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