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

pub struct Address { /* fields omitted */ }

Representation of an Ethereum address.

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

Methods

impl Address
[src]

Creates new Address filled with zeros.

The actual implementation of this doesn't really creates the zeros. In our case we treat it as "empty" address, which is then reperesented by zeros.

Get raw bytes of the address.

Trait Implementations

impl Default for Address
[src]

Construct a default Address filled with zeros.

impl ToString for Address
[src]

Creates a textual representation of the Address.

Examples

use clarity::Address;
let address = Address::default();
address.to_string(); // 0x0000000000000000000000000000000000000000

impl PartialEq<Address> for Address
[src]

impl From<Address> for Token
[src]

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

impl<'a> From<&'a [u8]> for Address
[src]

impl Eq for Address
[src]

impl Clone for Address
[src]

Performs copy-assignment from source. Read more

impl PartialOrd<Address> for Address
[src]

impl Debug for Address
[src]

impl Hash for Address
[src]

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

impl FromStr for Address
[src]

The associated error which can be returned from parsing.

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 LowerHex for Address
[src]

impl UpperHex for Address
[src]

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> ToOwned for T where
    T: Clone
[src]

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

impl<T> From for T
[src]

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

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

🔬 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]

🔬 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

Should always be Self