Struct chain_addr::Address
source · pub struct Address(pub Discrimination, pub Kind);
Expand description
An unstructured address including the discrimination and the kind of address
Tuple Fields§
§0: Discrimination
§1: Kind
Implementations§
source§impl Address
impl Address
pub fn discrimination(&self) -> Discrimination
pub fn kind(&self) -> &Kind
source§impl Address
impl Address
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Try to convert from_bytes
sourcepub fn to_kind_type(&self) -> KindType
pub fn to_kind_type(&self) -> KindType
Return the Kind type of a given address
pub(crate) fn to_kind_value(&self) -> u8
sourcepub fn base32(&self) -> String
pub fn base32(&self) -> String
create a base32 encoding of the byte serialization
This is not the official normal human representation for the address, but is used for debug / other.
pub fn public_key(&self) -> Option<&PublicKey<Ed25519>>
Trait Implementations§
source§impl Arbitrary for Address
impl Arbitrary for Address
§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
source§impl Deserialize for Address
impl Deserialize for Address
fn deserialize<R: Read>(codec: &mut Codec<R>) -> Result<Self, ReadError>
fn deserialize_validate<R>(codec: &mut Codec<R>) -> Result<(), ReadError>where R: Read,
source§impl Ord for Address
impl Ord for Address
source§impl PartialEq<Address> for Address
impl PartialEq<Address> for Address
source§impl PartialOrd<Address> for Address
impl PartialOrd<Address> for Address
1.0.0 · source§fn 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 moresource§impl Serialize for Address
impl Serialize for Address
impl Eq for Address
impl StructuralEq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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