#[repr(transparent)]pub struct Address(pub FixedBytes<20>);Expand description
An Ethereum address, 20 bytes in length.
This type is separate from FixedBytes<20>
and is declared with the wrap_fixed_bytes! macro. This allows us
to implement address-specific functionality.
The main difference with the generic FixedBytes implementation is that
Display formats the address using its EIP-55 checksum
(to_checksum).
Use Debug to display the raw bytes without the checksum.
§Examples
Parsing and formatting:
use alloy_primitives::{address, Address};
let checksummed = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
let expected = address!("0xd8da6bf26964af9d7eed9e03e53415d37aa96045");
let address = Address::parse_checksummed(checksummed, None).expect("valid checksum");
assert_eq!(address, expected);
// Format the address with the checksum
assert_eq!(address.to_string(), checksummed);
assert_eq!(address.to_checksum(None), checksummed);
// Format the compressed checksummed address
assert_eq!(format!("{address:#}"), "0xd8dA…6045");
// Format the address without the checksum
assert_eq!(format!("{address:?}"), "0xd8da6bf26964af9d7eed9e03e53415d37aa96045");Tuple Fields§
§0: FixedBytes<20>Implementations§
Source§impl Address
impl Address
Sourcepub const fn with_last_byte(x: u8) -> Self
pub const fn with_last_byte(x: u8) -> Self
Creates a new byte array with the last byte set to x.
Sourcepub const fn repeat_byte(byte: u8) -> Self
pub const fn repeat_byte(byte: u8) -> Self
Creates a new byte array where all bytes are set to byte.
Sourcepub fn random() -> Self
Available on crate feature getrandom only.
pub fn random() -> Self
getrandom only.Creates a new fixed byte array with the default cryptographic random number generator.
This is rand::thread_rng if the “rand” and “std” features are enabled, otherwise
it uses getrandom::getrandom. Both are cryptographically secure.
Sourcepub fn try_random() -> Result<Self, Error>
Available on crate feature getrandom only.
pub fn try_random() -> Result<Self, Error>
getrandom only.Tries to create a new fixed byte array with the default cryptographic random number generator.
See random for more details.
Sourcepub fn randomize(&mut self)
Available on crate feature getrandom only.
pub fn randomize(&mut self)
getrandom only.Fills this fixed byte array with the default cryptographic random number generator.
See random for more details.
Sourcepub fn try_randomize(&mut self) -> Result<(), Error>
Available on crate feature getrandom only.
pub fn try_randomize(&mut self) -> Result<(), Error>
getrandom only.Tries to fill this fixed byte array with the default cryptographic random number generator.
See random for more details.
Sourcepub fn random_with<R: RngCore + ?Sized>(rng: &mut R) -> Self
Available on crate feature rand only.
pub fn random_with<R: RngCore + ?Sized>(rng: &mut R) -> Self
rand only.Creates a new fixed byte array with the given random number generator.
Sourcepub fn try_random_with<R: TryRngCore + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
Available on crate feature rand only.
pub fn try_random_with<R: TryRngCore + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
rand only.Tries to create a new fixed byte array with the given random number generator.
Sourcepub fn randomize_with<R: RngCore + ?Sized>(&mut self, rng: &mut R)
Available on crate feature rand only.
pub fn randomize_with<R: RngCore + ?Sized>(&mut self, rng: &mut R)
rand only.Fills this fixed byte array with the given random number generator.
Sourcepub fn try_randomize_with<R: TryRngCore + ?Sized>(
&mut self,
rng: &mut R,
) -> Result<(), R::Error>
Available on crate feature rand only.
pub fn try_randomize_with<R: TryRngCore + ?Sized>( &mut self, rng: &mut R, ) -> Result<(), R::Error>
rand only.Tries to fill this fixed byte array with the given random number generator.
Sourcepub fn from_slice(src: &[u8]) -> Self
pub fn from_slice(src: &[u8]) -> Self
Sourcepub fn left_padding_from(value: &[u8]) -> Self
pub fn left_padding_from(value: &[u8]) -> Self
Sourcepub fn right_padding_from(value: &[u8]) -> Self
pub fn right_padding_from(value: &[u8]) -> Self
Sourcepub const fn into_array(self) -> [u8; 20]
pub const fn into_array(self) -> [u8; 20]
Returns the inner bytes array.
Source§impl Address
impl Address
Sourcepub fn from_word(word: FixedBytes<32>) -> Self
pub fn from_word(word: FixedBytes<32>) -> Self
Creates an Ethereum address from an EVM word’s upper 20 bytes
(word[12..]).
§Examples
let word = b256!("0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045");
assert_eq!(Address::from_word(word), address!("0xd8da6bf26964af9d7eed9e03e53415d37aa96045"));Sourcepub fn into_word(&self) -> FixedBytes<32>
pub fn into_word(&self) -> FixedBytes<32>
Left-pads the address to 32 bytes (EVM word size).
§Examples
assert_eq!(
address!("0xd8da6bf26964af9d7eed9e03e53415d37aa96045").into_word(),
b256!("0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"),
);Sourcepub fn parse_checksummed<S: AsRef<str>>(
s: S,
chain_id: Option<u64>,
) -> Result<Self, AddressError>
pub fn parse_checksummed<S: AsRef<str>>( s: S, chain_id: Option<u64>, ) -> Result<Self, AddressError>
Parse an Ethereum address, verifying its EIP-55 checksum.
You can optionally specify an EIP-155 chain ID to check the address using EIP-1191.
§Errors
This method returns an error if the provided string does not match the expected checksum.
§Examples
let checksummed = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
let address = Address::parse_checksummed(checksummed, None).unwrap();
let expected = address!("0xd8da6bf26964af9d7eed9e03e53415d37aa96045");
assert_eq!(address, expected);Sourcepub fn to_checksum(&self, chain_id: Option<u64>) -> String
pub fn to_checksum(&self, chain_id: Option<u64>) -> String
Encodes an Ethereum address to its EIP-55 checksum into a heap-allocated string.
You can optionally specify an EIP-155 chain ID to encode the address using EIP-1191.
§Examples
let address = address!("0xd8da6bf26964af9d7eed9e03e53415d37aa96045");
let checksummed: String = address.to_checksum(None);
assert_eq!(checksummed, "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");
let checksummed: String = address.to_checksum(Some(1));
assert_eq!(checksummed, "0xD8Da6bf26964Af9d7EEd9e03e53415d37AA96045");Sourcepub fn to_checksum_raw<'a>(
&self,
buf: &'a mut [u8],
chain_id: Option<u64>,
) -> &'a mut str
pub fn to_checksum_raw<'a>( &self, buf: &'a mut [u8], chain_id: Option<u64>, ) -> &'a mut str
Encodes an Ethereum address to its EIP-55 checksum into the given buffer.
For convenience, the buffer is returned as a &mut str, as the bytes
are guaranteed to be valid UTF-8.
You can optionally specify an EIP-155 chain ID to encode the address using EIP-1191.
§Panics
Panics if buf is not exactly 42 bytes long.
§Examples
let address = address!("0xd8da6bf26964af9d7eed9e03e53415d37aa96045");
let mut buf = [0; 42];
let checksummed: &mut str = address.to_checksum_raw(&mut buf, None);
assert_eq!(checksummed, "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");
let checksummed: &mut str = address.to_checksum_raw(&mut buf, Some(1));
assert_eq!(checksummed, "0xD8Da6bf26964Af9d7EEd9e03e53415d37AA96045");Sourcepub fn to_checksum_buffer(&self, chain_id: Option<u64>) -> AddressChecksumBuffer
pub fn to_checksum_buffer(&self, chain_id: Option<u64>) -> AddressChecksumBuffer
Encodes an Ethereum address to its EIP-55 checksum into a stack-allocated buffer.
You can optionally specify an EIP-155 chain ID to encode the address using EIP-1191.
§Examples
let address = address!("0xd8da6bf26964af9d7eed9e03e53415d37aa96045");
let mut buffer: AddressChecksumBuffer = address.to_checksum_buffer(None);
assert_eq!(buffer.as_str(), "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");
let checksummed: &str = buffer.format(&address, Some(1));
assert_eq!(checksummed, "0xD8Da6bf26964Af9d7EEd9e03e53415d37AA96045");Sourcepub fn create(&self, nonce: u64) -> Self
Available on crate feature rlp only.
pub fn create(&self, nonce: u64) -> Self
rlp only.Computes the create address for this address and nonce:
keccak256(rlp([sender, nonce]))[12:]
§Examples
let sender = address!("0xb20a608c624Ca5003905aA834De7156C68b2E1d0");
let expected = address!("0x00000000219ab540356cBB839Cbe05303d7705Fa");
assert_eq!(sender.create(0), expected);
let expected = address!("0xe33c6e89e69d085897f98e92b06ebd541d1daa99");
assert_eq!(sender.create(1), expected);Sourcepub fn create2_from_code<S, C>(&self, salt: S, init_code: C) -> Self
pub fn create2_from_code<S, C>(&self, salt: S, init_code: C) -> Self
Computes the CREATE2 address of a smart contract as specified in
EIP-1014:
keccak256(0xff ++ address ++ salt ++ keccak256(init_code))[12:]
The init_code is the code that, when executed, produces the runtime
bytecode that will be placed into the state, and which typically is used
by high level languages to implement a ‘constructor’.
§Examples
let address = address!("0x8ba1f109551bD432803012645Ac136ddd64DBA72");
let salt = b256!("0x7c5ea36004851c764c44143b1dcb59679b11c9a68e5f41497f6cf3d480715331");
let init_code = bytes!("6394198df16000526103ff60206004601c335afa6040516060f3");
let expected = address!("0x533ae9d683B10C02EbDb05471642F85230071FC3");
assert_eq!(address.create2_from_code(salt, init_code), expected);Sourcepub fn create2<S, H>(&self, salt: S, init_code_hash: H) -> Self
pub fn create2<S, H>(&self, salt: S, init_code_hash: H) -> Self
Computes the CREATE2 address of a smart contract as specified in
EIP-1014, taking the pre-computed hash of the init code as input:
keccak256(0xff ++ address ++ salt ++ init_code_hash)[12:]
The init_code is the code that, when executed, produces the runtime
bytecode that will be placed into the state, and which typically is used
by high level languages to implement a ‘constructor’.
§Examples
let address = address!("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f");
let salt = b256!("0x2b2f5776e38002e0c013d0d89828fdb06fee595ea2d5ed4b194e3883e823e350");
let init_code_hash =
b256!("0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f");
let expected = address!("0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852");
assert_eq!(address.create2(salt, init_code_hash), expected);Sourcepub fn create_eof<S>(&self, salt: S) -> Self
pub fn create_eof<S>(&self, salt: S) -> Self
Computes the address created by the EOFCREATE opcode, where self is the sender.
The address is calculated as keccak256(0xff || sender32 || salt)[12:], where sender32 is
the sender address left-padded to 32 bytes with zeros.
See EIP-7620 for more details.
§Examples
let address = address!("0xb20a608c624Ca5003905aA834De7156C68b2E1d0");
let salt = b256!("0x7c5ea36004851c764c44143b1dcb59679b11c9a68e5f41497f6cf3d480715331");
// Create an address using CREATE_EOF
let eof_address = address.create_eof(salt);Sourcepub fn from_raw_public_key(pubkey: &[u8]) -> Self
pub fn from_raw_public_key(pubkey: &[u8]) -> Self
Sourcepub fn from_public_key(pubkey: &VerifyingKey) -> Self
Available on crate feature k256 only.
pub fn from_public_key(pubkey: &VerifyingKey) -> Self
k256 only.Converts an ECDSA verifying key to its corresponding Ethereum address.
Sourcepub fn from_private_key(private_key: &SigningKey) -> Self
Available on crate feature k256 only.
pub fn from_private_key(private_key: &SigningKey) -> Self
k256 only.Converts an ECDSA signing key to its corresponding Ethereum address.
Methods from Deref<Target = FixedBytes<20>>§
pub const ZERO: Self
Sourcepub fn randomize(&mut self)
Available on crate feature getrandom only.
pub fn randomize(&mut self)
getrandom only.Fills this FixedBytes with the default cryptographic random number generator.
See random for more details.
Sourcepub fn try_randomize(&mut self) -> Result<(), Error>
Available on crate feature getrandom only.
pub fn try_randomize(&mut self) -> Result<(), Error>
getrandom only.Tries to fill this FixedBytes with the default cryptographic random number
generator.
See random for more details.
Sourcepub fn randomize_with<R: RngCore + ?Sized>(&mut self, rng: &mut R)
Available on crate feature rand only.
pub fn randomize_with<R: RngCore + ?Sized>(&mut self, rng: &mut R)
rand only.Fills this FixedBytes with the given random number generator.
Sourcepub fn try_randomize_with<R: TryRngCore + ?Sized>(
&mut self,
rng: &mut R,
) -> Result<(), R::Error>
Available on crate feature rand only.
pub fn try_randomize_with<R: TryRngCore + ?Sized>( &mut self, rng: &mut R, ) -> Result<(), R::Error>
rand only.Tries to fill this FixedBytes with the given random number generator.
Sourcepub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_slice(&self) -> &[u8] ⓘ
Returns a slice containing the entire array. Equivalent to &s[..].
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns a mutable slice containing the entire array. Equivalent to
&mut s[..].
Sourcepub fn covers(&self, other: &Self) -> bool
pub fn covers(&self, other: &Self) -> bool
Returns true if all bits set in self are also set in b.
Sourcepub fn const_eq(&self, other: &Self) -> bool
pub fn const_eq(&self, other: &Self) -> bool
Compile-time equality. NOT constant-time equality.
Sourcepub fn const_is_zero(&self) -> bool
pub fn const_is_zero(&self) -> bool
Returns true if no bits are set.
Methods from Deref<Target = [u8; N]>§
pub fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
pub fn as_ascii(&self) -> Option<&[AsciiChar; N]>
ascii_char)Converts this array of bytes into an array of ASCII characters,
or returns None if any of the characters is non-ASCII.
§Examples
#![feature(ascii_char)]
const HEX_DIGITS: [std::ascii::Char; 16] =
*b"0123456789abcdef".as_ascii().unwrap();
assert_eq!(HEX_DIGITS[1].as_str(), "1");
assert_eq!(HEX_DIGITS[10].as_str(), "a");pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
ascii_char)Converts this array of bytes into an array of ASCII characters, without checking whether they’re valid.
§Safety
Every byte in the array must be in 0..=127, or else this is UB.
1.57.0pub fn as_slice(&self) -> &[T]
pub fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
1.57.0pub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to
&mut s[..].
1.77.0pub fn each_ref(&self) -> [&T; N]
pub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same
size as self.
§Example
let floats = [3.1, 2.7, -1.0];
let float_refs: [&f64; 3] = floats.each_ref();
assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);This method is particularly useful if combined with other methods, like
map. This way, you can avoid moving the original
array if its elements are not Copy.
let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
let is_ascii = strings.each_ref().map(|s| s.is_ascii());
assert_eq!(is_ascii, [true, false, true]);
// We can still access the original array: it has not been moved.
assert_eq!(strings.len(), 3);1.77.0pub fn each_mut(&mut self) -> [&mut T; N]
pub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references
with the same size as self.
§Example
let mut floats = [3.1, 2.7, -1.0];
let float_refs: [&mut f64; 3] = floats.each_mut();
*float_refs[0] = 0.0;
assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);
assert_eq!(floats, [0.0, 2.7, -1.0]);pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
split_array)Divides one array reference into two at an index.
The first will contain all indices from [0, M) (excluding
the index M itself) and the second will contain all
indices from [M, N) (excluding the index N itself).
§Panics
Panics if M > N.
§Examples
#![feature(split_array)]
let v = [1, 2, 3, 4, 5, 6];
{
let (left, right) = v.split_array_ref::<0>();
assert_eq!(left, &[]);
assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
}
{
let (left, right) = v.split_array_ref::<2>();
assert_eq!(left, &[1, 2]);
assert_eq!(right, &[3, 4, 5, 6]);
}
{
let (left, right) = v.split_array_ref::<6>();
assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
assert_eq!(right, &[]);
}pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
split_array)Divides one mutable array reference into two at an index.
The first will contain all indices from [0, M) (excluding
the index M itself) and the second will contain all
indices from [M, N) (excluding the index N itself).
§Panics
Panics if M > N.
§Examples
#![feature(split_array)]
let mut v = [1, 0, 3, 0, 5, 6];
let (left, right) = v.split_array_mut::<2>();
assert_eq!(left, &mut [1, 0][..]);
assert_eq!(right, &mut [3, 0, 5, 6]);
left[1] = 2;
right[1] = 4;
assert_eq!(v, [1, 2, 3, 4, 5, 6]);pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
split_array)Divides one array reference into two at an index from the end.
The first will contain all indices from [0, N - M) (excluding
the index N - M itself) and the second will contain all
indices from [N - M, N) (excluding the index N itself).
§Panics
Panics if M > N.
§Examples
#![feature(split_array)]
let v = [1, 2, 3, 4, 5, 6];
{
let (left, right) = v.rsplit_array_ref::<0>();
assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
assert_eq!(right, &[]);
}
{
let (left, right) = v.rsplit_array_ref::<2>();
assert_eq!(left, &[1, 2, 3, 4]);
assert_eq!(right, &[5, 6]);
}
{
let (left, right) = v.rsplit_array_ref::<6>();
assert_eq!(left, &[]);
assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
}pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
split_array)Divides one mutable array reference into two at an index from the end.
The first will contain all indices from [0, N - M) (excluding
the index N - M itself) and the second will contain all
indices from [N - M, N) (excluding the index N itself).
§Panics
Panics if M > N.
§Examples
#![feature(split_array)]
let mut v = [1, 0, 3, 0, 5, 6];
let (left, right) = v.rsplit_array_mut::<4>();
assert_eq!(left, &mut [1, 0]);
assert_eq!(right, &mut [3, 0, 5, 6][..]);
left[1] = 2;
right[1] = 4;
assert_eq!(v, [1, 2, 3, 4, 5, 6]);Trait Implementations§
Source§impl Allocative for Address
Available on crate feature allocative only.
impl Allocative for Address
allocative only.Source§impl<'a> Arbitrary<'a> for Address
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for Address
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Arbitrary for Address
Available on crate feature arbitrary only.
impl Arbitrary for Address
arbitrary only.Source§type Parameters = <FixedBytes<20> as Arbitrary>::Parameters
type Parameters = <FixedBytes<20> as Arbitrary>::Parameters
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = Map<<FixedBytes<20> as Arbitrary>::Strategy, fn(FixedBytes<20>) -> Address>
type Strategy = Map<<FixedBytes<20> as Arbitrary>::Strategy, fn(FixedBytes<20>) -> Address>
Strategy used to generate values of type Self.Source§fn arbitrary_with(args: Self::Parameters) -> Self::Strategy
fn arbitrary_with(args: Self::Parameters) -> Self::Strategy
Source§impl Archive for Addresswhere
FixedBytes<20>: Archive,
impl Archive for Addresswhere
FixedBytes<20>: Archive,
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedAddress
type Archived = ArchivedAddress
Source§type Resolver = AddressResolver
type Resolver = AddressResolver
Source§impl AsExpression<Binary> for &Address
impl AsExpression<Binary> for &Address
Source§type Expression = Bound<Binary, &Address>
type Expression = Bound<Binary, &Address>
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl AsExpression<Binary> for Address
impl AsExpression<Binary> for Address
Source§type Expression = Bound<Binary, Address>
type Expression = Bound<Binary, Address>
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl AsExpression<Nullable<Binary>> for &Address
impl AsExpression<Nullable<Binary>> for &Address
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl AsExpression<Nullable<Binary>> for Address
impl AsExpression<Nullable<Binary>> for Address
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl AsMut<FixedBytes<20>> for Address
impl AsMut<FixedBytes<20>> for Address
Source§fn as_mut(&mut self) -> &mut FixedBytes<20>
fn as_mut(&mut self) -> &mut FixedBytes<20>
Source§impl AsRef<FixedBytes<20>> for Address
impl AsRef<FixedBytes<20>> for Address
Source§fn as_ref(&self) -> &FixedBytes<20>
fn as_ref(&self) -> &FixedBytes<20>
Source§impl BitAndAssign<&Address> for Address
impl BitAndAssign<&Address> for Address
Source§fn bitand_assign(&mut self, rhs: &Self)
fn bitand_assign(&mut self, rhs: &Self)
&= operation. Read moreSource§impl BitAndAssign for Address
impl BitAndAssign for Address
Source§fn bitand_assign(&mut self, __rhs: Self)
fn bitand_assign(&mut self, __rhs: Self)
&= operation. Read moreSource§impl BitOrAssign<&Address> for Address
impl BitOrAssign<&Address> for Address
Source§fn bitor_assign(&mut self, rhs: &Self)
fn bitor_assign(&mut self, rhs: &Self)
|= operation. Read moreSource§impl BitOrAssign for Address
impl BitOrAssign for Address
Source§fn bitor_assign(&mut self, __rhs: Self)
fn bitor_assign(&mut self, __rhs: Self)
|= operation. Read moreSource§impl BitXorAssign<&Address> for Address
impl BitXorAssign<&Address> for Address
Source§fn bitxor_assign(&mut self, rhs: &Self)
fn bitxor_assign(&mut self, rhs: &Self)
^= operation. Read moreSource§impl BitXorAssign for Address
impl BitXorAssign for Address
Source§fn bitxor_assign(&mut self, __rhs: Self)
fn bitxor_assign(&mut self, __rhs: Self)
^= operation. Read moreSource§impl BorshDeserialize for Address
Available on crate feature borsh only.
impl BorshDeserialize for Address
borsh only.fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for Address
Available on crate feature borsh only.
impl BorshSerialize for Address
borsh only.Source§impl<'de> Deserialize<'de> for Address
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Address
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl<__D: Fallible + ?Sized> Deserialize<Address, __D> for Archived<Address>where
FixedBytes<20>: Archive,
<FixedBytes<20> as Archive>::Archived: Deserialize<FixedBytes<20>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<Address, __D> for Archived<Address>where
FixedBytes<20>: Archive,
<FixedBytes<20> as Archive>::Archived: Deserialize<FixedBytes<20>, __D>,
Source§impl Distribution<Address> for StandardUniform
Available on crate feature rand only.
impl Distribution<Address> for StandardUniform
rand only.Source§impl<'a, DB> Encode<'a, DB> for Address
impl<'a, DB> Encode<'a, DB> for Address
Source§fn encode_by_ref(
&self,
buf: &mut <DB as Database>::ArgumentBuffer<'a>,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'a>, ) -> Result<IsNull, BoxDynError>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl From<Address> for FixedBytes<20>
impl From<Address> for FixedBytes<20>
Source§impl From<ArchivedAddress> for Address
Available on crate feature rkyv only.
impl From<ArchivedAddress> for Address
rkyv only.Source§fn from(archived: ArchivedAddress) -> Self
fn from(archived: ArchivedAddress) -> Self
Source§impl From<FixedBytes<20>> for Address
impl From<FixedBytes<20>> for Address
Source§fn from(value: FixedBytes<20>) -> Self
fn from(value: FixedBytes<20>) -> Self
Source§impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime Addresswhere
&'__deriveMoreLifetime FixedBytes<20>: IntoIterator,
impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime Addresswhere
&'__deriveMoreLifetime FixedBytes<20>: IntoIterator,
Source§type Item = <&'__deriveMoreLifetime FixedBytes<20> as IntoIterator>::Item
type Item = <&'__deriveMoreLifetime FixedBytes<20> as IntoIterator>::Item
Source§type IntoIter = <&'__deriveMoreLifetime FixedBytes<20> as IntoIterator>::IntoIter
type IntoIter = <&'__deriveMoreLifetime FixedBytes<20> as IntoIterator>::IntoIter
Source§impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime mut Addresswhere
&'__deriveMoreLifetime mut FixedBytes<20>: IntoIterator,
impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime mut Addresswhere
&'__deriveMoreLifetime mut FixedBytes<20>: IntoIterator,
Source§type Item = <&'__deriveMoreLifetime mut FixedBytes<20> as IntoIterator>::Item
type Item = <&'__deriveMoreLifetime mut FixedBytes<20> as IntoIterator>::Item
Source§type IntoIter = <&'__deriveMoreLifetime mut FixedBytes<20> as IntoIterator>::IntoIter
type IntoIter = <&'__deriveMoreLifetime mut FixedBytes<20> as IntoIterator>::IntoIter
Source§impl IntoIterator for Addresswhere
FixedBytes<20>: IntoIterator,
impl IntoIterator for Addresswhere
FixedBytes<20>: IntoIterator,
Source§type Item = <FixedBytes<20> as IntoIterator>::Item
type Item = <FixedBytes<20> as IntoIterator>::Item
Source§type IntoIter = <FixedBytes<20> as IntoIterator>::IntoIter
type IntoIter = <FixedBytes<20> as IntoIterator>::IntoIter
Source§impl Ord for Address
impl Ord for Address
Source§impl PartialOrd<&[u8]> for Address
impl PartialOrd<&[u8]> for Address
Source§impl PartialOrd<&Address> for [u8]
impl PartialOrd<&Address> for [u8]
Source§impl PartialOrd<[u8]> for &Address
impl PartialOrd<[u8]> for &Address
Source§impl PartialOrd<[u8]> for Address
impl PartialOrd<[u8]> for Address
Source§impl PartialOrd<Address> for &[u8]
impl PartialOrd<Address> for &[u8]
Source§impl PartialOrd<Address> for [u8]
impl PartialOrd<Address> for [u8]
Source§impl PartialOrd for Address
impl PartialOrd for Address
impl Copy for Address
impl Eq for Address
impl MaxEncodedLen<{ $len }> for Address
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> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
ToHexExt insteadself into the result.
Lower case letters are used (e.g. f9b4ca).Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
ToHexExt insteadself into the result.
Upper case letters are used (e.g. F9B4CA).Source§impl<T> ToHexExt for T
impl<T> ToHexExt for T
Source§fn encode_hex(&self) -> String
fn encode_hex(&self) -> String
self into the result.
Lower case letters are used (e.g. f9b4ca).Source§fn encode_hex_upper(&self) -> String
fn encode_hex_upper(&self) -> String
self into the result.
Upper case letters are used (e.g. F9B4CA).Source§fn encode_hex_with_prefix(&self) -> String
fn encode_hex_with_prefix(&self) -> String
self into the result with prefix 0x.
Lower case letters are used (e.g. 0xf9b4ca).Source§fn encode_hex_upper_with_prefix(&self) -> String
fn encode_hex_upper_with_prefix(&self) -> String
self into the result with prefix 0X.
Upper case letters are used (e.g. 0xF9B4CA).Source§impl<T> WindowExpressionMethods for T
impl<T> WindowExpressionMethods for T
Source§fn over(self) -> Self::Outputwhere
Self: OverDsl,
fn over(self) -> Self::Outputwhere
Self: OverDsl,
Source§fn window_filter<P>(self, f: P) -> Self::Output
fn window_filter<P>(self, f: P) -> Self::Output
Source§fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
Source§fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 20 bytes