[][src]Struct clarity::address::Address

pub struct Address(_);

Representation of an Ethereum address.

Address is usually derived from a PrivateKey, or converted from its textual representation.

Methods

impl Address
[src]

pub fn as_bytes(&self) -> &[u8]
[src]

Get raw bytes of the address.

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

Creates an Address from a slice.

This requires a slice to be exactly 20 bytes in length,

Trait Implementations

impl From<Address> for Token
[src]

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

impl Eq for Address
[src]

impl PartialOrd<Address> for Address
[src]

impl Copy for Address
[src]

impl Default for Address
[src]

impl PartialEq<Address> for Address
[src]

impl Clone for Address
[src]

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

Performs copy-assignment from source. Read more

impl Ord for Address
[src]

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

Compares and returns the maximum of two values. Read more

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

Compares and returns the minimum of two values. Read more

impl Debug for Address
[src]

impl Display for Address
[src]

impl UpperHex for Address
[src]

impl LowerHex for Address
[src]

impl Hash for Address
[src]

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.

fn from_str(s: &str) -> Result<Self, Self::Err>
[src]

Parses a string into a valid Ethereum address.

Supported formats

  • 0x prefixed address
  • Raw bytes of an address represented by a bytes as an hexadecimal.

Examples

use clarity::Address;
// Method 1
Address::from_str("0x0102030405060708090a0b0c0d0e0f1011121314").unwrap();
// Method 1 (without 0x prefix)
Address::from_str("0102030405060708090a0b0c0d0e0f1011121314").unwrap();
// Method 2
let _address : Address = "14131211100f0e0d0c0b0a090807060504030201".parse().unwrap();

impl Serialize for Address
[src]

impl<'de> Deserialize<'de> for Address
[src]

Auto Trait Implementations

impl Send for Address

impl Sync for Address

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

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

type Error = !

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

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

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

The type returned in the event of a conversion error.

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self