pub struct EthAddress(/* private fields */);Expand description
Ethereum address (20 bytes). EthAddress::to_checksum returns
the EIP-55 mixed-case representation with 0x prefix.
Implementations§
Source§impl EthAddress
impl EthAddress
Sourcepub fn new(b: &[u8]) -> Result<Self, Error>
pub fn new(b: &[u8]) -> Result<Self, Error>
Construct a EthAddress from bytes. Returns
Error::LengthMismatch if b.len() does not match.
Sourcepub fn into_array(self) -> [u8; 20]
pub fn into_array(self) -> [u8; 20]
Consume into the inner array.
Source§impl EthAddress
impl EthAddress
Sourcepub fn to_checksum(&self) -> String
pub fn to_checksum(&self) -> String
EIP-55 checksum representation, 0x-prefixed.
Trait Implementations§
Source§impl Clone for EthAddress
impl Clone for EthAddress
Source§fn clone(&self) -> EthAddress
fn clone(&self) -> EthAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EthAddress
impl Debug for EthAddress
Source§impl<'de> Deserialize<'de> for EthAddress
impl<'de> Deserialize<'de> for EthAddress
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EthAddress
impl Display for EthAddress
Source§impl FromStr for EthAddress
impl FromStr for EthAddress
Source§impl Hash for EthAddress
impl Hash for EthAddress
Source§impl LowerHex for EthAddress
impl LowerHex for EthAddress
Source§impl PartialEq for EthAddress
impl PartialEq for EthAddress
Source§fn eq(&self, other: &EthAddress) -> bool
fn eq(&self, other: &EthAddress) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EthAddress
impl Serialize for EthAddress
impl Copy for EthAddress
impl Eq for EthAddress
impl StructuralPartialEq for EthAddress
Auto Trait Implementations§
impl Freeze for EthAddress
impl RefUnwindSafe for EthAddress
impl Send for EthAddress
impl Sync for EthAddress
impl Unpin for EthAddress
impl UnsafeUnpin for EthAddress
impl UnwindSafe for EthAddress
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.