pub struct Address(pub [u8; 20]);Expand description
20-byte EVM-compatible address (last 20 bytes of keccak256(pubkey)).
The address is the canonical user identifier in EIP-712 messages and in
the MTF state machine’s Address field.
Tuple Fields§
§0: [u8; 20]Implementations§
Source§impl Address
impl Address
Sourcepub const fn from_bytes(bytes: [u8; 20]) -> Address
pub const fn from_bytes(bytes: [u8; 20]) -> Address
Wrap a raw 20-byte address.
Sourcepub fn from_hex(s: &str) -> Result<Address, ClientError>
pub fn from_hex(s: &str) -> Result<Address, ClientError>
Parse a hex address (with or without 0x prefix).
§Errors
Returns ClientError::InvalidKey if the input is not 40 hex chars
or not valid hex.
Trait Implementations§
impl Copy for Address
Source§impl<'de> Deserialize<'de> for Address
impl<'de> Deserialize<'de> for Address
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Address, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Address, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Address
Source§impl Serialize for Address
impl Serialize for Address
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 UnsafeUnpin 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