[][src]Struct nash_protocol::types::blockchain::eth::Address

pub struct Address { /* fields omitted */ }

Ethereum addresses are 20 bytes of data that follow a specific encoding, usually represented by a hex string

Implementations

impl Address[src]

pub fn new(s: &str) -> Result<Self>[src]

Construct a new address from a string. FIXME: probably not a major issue, but we could consider other validation here as well FIXME: we could take a public key / Secp256k1Point as input (or Secp256r1Point in case of NEO) instead of an address, and convert that point to the blockchain-specific address then. In this way, we would at least ensure that the input represents a valid point on the curve.

pub fn to_bytes(&self) -> [u8; 20][src]

Serialize the address into bytes for payload creation

pub fn from_bytes(bytes: [u8; 20]) -> Result<Self>[src]

Create an address from ETH payload bytes

Trait Implementations

impl Clone for Address[src]

impl Debug for Address[src]

impl PartialEq<Address> for Address[src]

impl StructuralPartialEq for Address[src]

impl TryFrom<Address> for Address[src]

type Error = ProtocolError

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.