pub struct Address(/* private fields */);Expand description
Fixed-width Ethereum address bytes.
Equality is constant-time because recovered sender checks appear in authentication and authorization paths.
The Hash implementation is for ordinary map/set use. Do not rely on
hash-map lookup timing for secret or side-channel-sensitive access-control
paths; use explicit indexed structures or constant-time scans there.
Implementations§
Source§impl Address
impl Address
Sourcepub fn encoded_rlp_len(self) -> Result<usize, PrimitiveRlpError>
pub fn encoded_rlp_len(self) -> Result<usize, PrimitiveRlpError>
Returns the canonical RLP encoded length.
This is currently infallible for the fixed 20-byte address payload but
keeps the same Result shape as the other primitive bridge helpers.
Sourcepub fn encode_rlp(self, output: &mut [u8]) -> Result<usize, PrimitiveRlpError>
pub fn encode_rlp(self, output: &mut [u8]) -> Result<usize, PrimitiveRlpError>
Canonically encodes this address as a fixed-width scalar.
Returns the number of bytes written. output is not modified unless
this function returns Ok.
Sourcepub fn try_from_rlp(
input: &[u8],
limits: DecodeLimits,
) -> Result<Self, PrimitiveRlpError>
pub fn try_from_rlp( input: &[u8], limits: DecodeLimits, ) -> Result<Self, PrimitiveRlpError>
Decodes exactly one fixed-width address scalar.
Trait Implementations§
impl Copy for Address
impl Eq for Address
Source§impl RlpDecode for Address
impl RlpDecode for Address
Source§type Error = PrimitiveRlpError
type Error = PrimitiveRlpError
Error returned by this decoder.
Source§fn decode_rlp(input: &[u8], limits: DecodeLimits) -> Result<Self, Self::Error>
fn decode_rlp(input: &[u8], limits: DecodeLimits) -> Result<Self, Self::Error>
Decodes exactly one canonical RLP item from
input.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