pub struct Address { /* private fields */ }Expand description
Ethereum addresses are 20 bytes of data that follow a specific encoding, usually represented by a hex string
Implementations§
Source§impl Address
impl Address
Sourcepub fn new(s: &str) -> Result<Self>
pub fn new(s: &str) -> Result<Self>
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.
Sourcepub fn from_bytes(bytes: [u8; 20]) -> Result<Self>
pub fn from_bytes(bytes: [u8; 20]) -> Result<Self>
Create an address from ETH payload bytes
Trait Implementations§
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more