[][src]Struct webchain_rs::Address

pub struct Address(pub [u8; 20]);

Account address (20 bytes)

Methods

impl Address[src]

pub fn try_from(data: &[u8]) -> Result<Self, Error>[src]

Try to convert a byte vector to Address.

Arguments

  • data - A byte slice with ADDRESS_BYTES length

Example

let addr = emerald_rs::Address::try_from(&[0u8; emerald_rs::ADDRESS_BYTES]).unwrap();
assert_eq!(addr.to_string(), "0x0000000000000000000000000000000000000000");

Trait Implementations

impl Clone for Address[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for Address[src]

default fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

default fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

default fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Eq for Address[src]

impl PartialOrd<Address> for Address[src]

impl Copy for Address[src]

impl PartialEq<Address> for Address[src]

impl Default for Address[src]

impl From<[u8; 20]> for Address[src]

impl Display for Address[src]

impl Debug for Address[src]

impl Deref for Address[src]

type Target = [u8]

The resulting type after dereferencing.

impl Hash for Address[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl FromStr for Address[src]

type Err = Error

The associated error which can be returned from parsing.

impl Encodable for Address[src]

impl Decodable for Address[src]

Auto Trait Implementations

impl Send for Address

impl Sync for Address

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

default fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Erased for T