Struct reth::primitives::alloy_primitives::Address

#[repr(transparent)]
pub struct Address(pub FixedBytes<20>);
Expand description

An Ethereum address, 20 bytes in length.

This type is separate from B160 / 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!("d8da6bf26964af9d7eed9e03e53415d37aa96045");
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§

§

impl Address

pub const ZERO: Address = _

Array of Zero bytes.

pub const fn new(bytes: [u8; 20]) -> Address

Wraps the given byte array in this type.

pub const fn with_last_byte(x: u8) -> Address

Creates a new byte array with the last byte set to x.

pub const fn repeat_byte(byte: u8) -> Address

Creates a new byte array where all bytes are set to byte.

pub const fn len_bytes() -> usize

Returns the size of this array in bytes.

pub fn random() -> Address

Instantiates a new fixed byte array with cryptographically random content.

§Panics

Panics if the underlying call to getrandom_uninit fails.

pub fn try_random() -> Result<Address, Error>

Tries to create a new fixed byte array with cryptographically random content.

§Errors

This function only propagates the error from the underlying call to getrandom_uninit.

pub fn randomize(&mut self)

Fills this fixed byte array with cryptographically random content.

§Panics

Panics if the underlying call to getrandom_uninit fails.

pub fn try_randomize(&mut self) -> Result<(), Error>

Tries to fill this fixed byte array with cryptographically random content.

§Errors

This function only propagates the error from the underlying call to getrandom_uninit.

pub fn random_with<R>(rng: &mut R) -> Address
where R: Rng + ?Sized,

Creates a new fixed byte array with the given random number generator.

pub fn randomize_with<R>(&mut self, rng: &mut R)
where R: Rng + ?Sized,

Fills this fixed byte array with the given random number generator.

pub fn from_slice(src: &[u8]) -> Address

Create a new byte array from the given slice src.

For a fallible version, use the TryFrom<&[u8]> implementation.

§Note

The given bytes are interpreted in big endian order.

§Panics

If the length of src and the number of bytes in Self do not match.

pub fn left_padding_from(value: &[u8]) -> Address

Create a new byte array from the given slice src, left-padding it with zeroes if necessary.

§Note

The given bytes are interpreted in big endian order.

§Panics

Panics if src.len() > N.

pub fn right_padding_from(value: &[u8]) -> Address

Create a new byte array from the given slice src, right-padding it with zeroes if necessary.

§Note

The given bytes are interpreted in big endian order.

§Panics

Panics if src.len() > N.

pub const fn into_array(self) -> [u8; 20]

Returns the inner bytes array.

pub fn covers(&self, b: &Address) -> bool

Returns true if all bits set in b are also set in self.

pub const fn const_eq(&self, other: &Address) -> bool

Compile-time equality. NOT constant-time equality.

pub const fn bit_and(self, rhs: Address) -> Address

Computes the bitwise AND of two FixedBytes.

pub const fn bit_or(self, rhs: Address) -> Address

Computes the bitwise OR of two FixedBytes.

pub const fn bit_xor(self, rhs: Address) -> Address

Computes the bitwise XOR of two FixedBytes.

§

impl Address

pub fn from_word(word: FixedBytes<32>) -> Address

Creates an Ethereum address from an EVM word’s upper 20 bytes (word[12..]).

§Examples
let word = b256!("000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045");
assert_eq!(Address::from_word(word), address!("d8da6bf26964af9d7eed9e03e53415d37aa96045"));

pub fn into_word(&self) -> FixedBytes<32>

Left-pads the address to 32 bytes (EVM word size).

§Examples
assert_eq!(
    address!("d8da6bf26964af9d7eed9e03e53415d37aa96045").into_word(),
    b256!("000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"),
);

pub fn parse_checksummed<S>( s: S, chain_id: Option<u64>, ) -> Result<Address, AddressError>
where S: AsRef<str>,

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!("d8da6bf26964af9d7eed9e03e53415d37aa96045");
assert_eq!(address, expected);

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!("d8da6bf26964af9d7eed9e03e53415d37aa96045");

let checksummed: String = address.to_checksum(None);
assert_eq!(checksummed, "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");

let checksummed: String = address.to_checksum(Some(1));
assert_eq!(checksummed, "0xD8Da6bf26964Af9d7EEd9e03e53415d37AA96045");

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!("d8da6bf26964af9d7eed9e03e53415d37aa96045");
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");

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!("d8da6bf26964af9d7eed9e03e53415d37aa96045");

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");

pub fn create(&self, nonce: u64) -> Address

Available on crate feature rlp only.

Computes the create address for this address and nonce:

keccak256(rlp([sender, nonce]))[12:]

§Examples
let sender = address!("b20a608c624Ca5003905aA834De7156C68b2E1d0");

let expected = address!("00000000219ab540356cBB839Cbe05303d7705Fa");
assert_eq!(sender.create(0), expected);

let expected = address!("e33c6e89e69d085897f98e92b06ebd541d1daa99");
assert_eq!(sender.create(1), expected);

pub fn create2_from_code<S, C>(&self, salt: S, init_code: C) -> Address
where S: Borrow<[u8; 32]>, C: AsRef<[u8]>,

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!("8ba1f109551bD432803012645Ac136ddd64DBA72");
let salt = b256!("7c5ea36004851c764c44143b1dcb59679b11c9a68e5f41497f6cf3d480715331");
let init_code = bytes!("6394198df16000526103ff60206004601c335afa6040516060f3");
let expected = address!("533ae9d683B10C02EbDb05471642F85230071FC3");
assert_eq!(address.create2_from_code(salt, init_code), expected);

pub fn create2<S, H>(&self, salt: S, init_code_hash: H) -> Address
where S: Borrow<[u8; 32]>, H: Borrow<[u8; 32]>,

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!("5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f");
let salt = b256!("2b2f5776e38002e0c013d0d89828fdb06fee595ea2d5ed4b194e3883e823e350");
let init_code_hash = b256!("96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f");
let expected = address!("0d4a11d5EEaaC28EC3F61d100daF4d40471f1852");
assert_eq!(address.create2(salt, init_code_hash), expected);

pub fn from_raw_public_key(pubkey: &[u8]) -> Address

Instantiate by hashing public key bytes.

§Panics

If the input is not exactly 64 bytes

pub fn from_public_key(pubkey: &VerifyingKey<Secp256k1>) -> Address

Available on crate feature k256 only.

Converts an ECDSA verifying key to its corresponding Ethereum address.

pub fn from_private_key(private_key: &SigningKey<Secp256k1>) -> Address

Available on crate feature k256 only.

Converts an ECDSA signing key to its corresponding Ethereum address.

Methods from Deref<Target = FixedBytes<20>>§

pub const ZERO: FixedBytes<N> = _

pub fn randomize(&mut self)

Available on crate feature getrandom only.

Fills this FixedBytes with cryptographically random content.

§Panics

Panics if the underlying call to getrandom_uninit fails.

pub fn try_randomize(&mut self) -> Result<(), Error>

Available on crate feature getrandom only.

Tries to fill this FixedBytes with cryptographically random content.

§Errors

This function only propagates the error from the underlying call to getrandom_uninit.

pub fn randomize_with<R>(&mut self, rng: &mut R)
where R: Rng + ?Sized,

Available on crate feature rand only.

Fills this FixedBytes with the given random number generator.

pub fn as_slice(&self) -> &[u8]

Returns a slice containing the entire array. Equivalent to &s[..].

pub fn as_mut_slice(&mut self) -> &mut [u8]

Returns a mutable slice containing the entire array. Equivalent to &mut s[..].

pub fn covers(&self, other: &FixedBytes<N>) -> bool

Returns true if all bits set in self are also set in b.

pub fn const_eq(&self, other: &FixedBytes<N>) -> bool

Compile-time equality. NOT constant-time equality.

pub fn is_zero(&self) -> bool

Returns true if no bits are set.

pub fn const_is_zero(&self) -> bool

Returns true if no bits are set.

Methods from Deref<Target = [u8; N]>§

source

pub fn as_ascii(&self) -> Option<&[AsciiChar; N]>

🔬This is a nightly-only experimental API. (ascii_char #110998)

Converts this array of bytes into a array of ASCII characters, or returns None if any of the characters is non-ASCII.

§Examples
#![feature(ascii_char)]
#![feature(const_option)]

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");
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]

🔬This is a nightly-only experimental API. (ascii_char #110998)

Converts this array of bytes into a 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.0 · source

pub fn as_slice(&self) -> &[T]

Returns a slice containing the entire array. Equivalent to &s[..].

1.57.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Returns a mutable slice containing the entire array. Equivalent to &mut s[..].

1.77.0 · source

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.0 · source

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]);
source

pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])

🔬This is a nightly-only experimental API. (split_array #90091)

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, &[]);
}
source

pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])

🔬This is a nightly-only experimental API. (split_array #90091)

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]);
source

pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])

🔬This is a nightly-only experimental API. (split_array #90091)

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]);
}
source

pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])

🔬This is a nightly-only experimental API. (split_array #90091)

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§

§

impl<'a> Arbitrary<'a> for Address

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Address, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Address, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

impl Arbitrary for Address

§

type Parameters = <FixedBytes<20> as Arbitrary>::Parameters

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = Map<<FixedBytes<20> as Arbitrary>::Strategy, fn(_: FixedBytes<20>) -> Address>

The type of Strategy used to generate values of type Self.
§

fn arbitrary() -> <Address as Arbitrary>::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
§

fn arbitrary_with( args: <Address as Arbitrary>::Parameters, ) -> <Address as Arbitrary>::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

impl AsMut<[u8]> for Address

§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl AsMut<[u8; 20]> for Address

§

fn as_mut(&mut self) -> &mut [u8; 20]

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl AsMut<FixedBytes<20>> for Address

§

fn as_mut(&mut self) -> &mut FixedBytes<20>

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl AsRef<[u8]> for Address

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl AsRef<[u8; 20]> for Address

§

fn as_ref(&self) -> &[u8; 20]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl AsRef<FixedBytes<20>> for Address

§

fn as_ref(&self) -> &FixedBytes<20>

Converts this type into a shared reference of the (usually inferred) input type.
§

impl BitAnd for Address

§

type Output = Address

The resulting type after applying the & operator.
§

fn bitand(self, rhs: Address) -> Address

Performs the & operation. Read more
§

impl BitAndAssign for Address

§

fn bitand_assign(&mut self, rhs: Address)

Performs the &= operation. Read more
§

impl BitOr for Address

§

type Output = Address

The resulting type after applying the | operator.
§

fn bitor(self, rhs: Address) -> Address

Performs the | operation. Read more
§

impl BitOrAssign for Address

§

fn bitor_assign(&mut self, rhs: Address)

Performs the |= operation. Read more
§

impl BitXor for Address

§

type Output = Address

The resulting type after applying the ^ operator.
§

fn bitxor(self, rhs: Address) -> Address

Performs the ^ operation. Read more
§

impl BitXorAssign for Address

§

fn bitxor_assign(&mut self, rhs: Address)

Performs the ^= operation. Read more
§

impl Borrow<[u8]> for &Address

§

fn borrow(&self) -> &[u8]

Immutably borrows from an owned value. Read more
§

impl Borrow<[u8]> for &mut Address

§

fn borrow(&self) -> &[u8]

Immutably borrows from an owned value. Read more
§

impl Borrow<[u8]> for Address

§

fn borrow(&self) -> &[u8]

Immutably borrows from an owned value. Read more
§

impl Borrow<[u8; 20]> for &Address

§

fn borrow(&self) -> &[u8; 20]

Immutably borrows from an owned value. Read more
§

impl Borrow<[u8; 20]> for &mut Address

§

fn borrow(&self) -> &[u8; 20]

Immutably borrows from an owned value. Read more
§

impl Borrow<[u8; 20]> for Address

§

fn borrow(&self) -> &[u8; 20]

Immutably borrows from an owned value. Read more
§

impl BorrowMut<[u8]> for &mut Address

§

fn borrow_mut(&mut self) -> &mut [u8]

Mutably borrows from an owned value. Read more
§

impl BorrowMut<[u8]> for Address

§

fn borrow_mut(&mut self) -> &mut [u8]

Mutably borrows from an owned value. Read more
§

impl BorrowMut<[u8; 20]> for &mut Address

§

fn borrow_mut(&mut self) -> &mut [u8; 20]

Mutably borrows from an owned value. Read more
§

impl BorrowMut<[u8; 20]> for Address

§

fn borrow_mut(&mut self) -> &mut [u8; 20]

Mutably borrows from an owned value. Read more
§

impl Clone for Address

§

fn clone(&self) -> Address

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Compact for Address

§

fn to_compact<B>(self, buf: &mut B) -> usize
where B: BufMut + AsMut<[u8]>,

Takes a buffer which can be written to. Ideally, it returns the length written to.
§

fn from_compact(buf: &[u8], len: usize) -> (Address, &[u8])

Takes a buffer which can be read from. Returns the object and buf with its internal cursor advanced (eg..advance(len)). Read more
§

fn specialized_to_compact<B>(self, buf: &mut B) -> usize
where B: BufMut + AsMut<[u8]>,

“Optional”: If there’s no good reason to use it, don’t.
§

fn specialized_from_compact(buf: &[u8], len: usize) -> (Self, &[u8])

“Optional”: If there’s no good reason to use it, don’t.
§

impl Compress for Address

§

type Compressed = Vec<u8>

Compressed type.
§

fn compress_to_buf<B>(self, buf: &mut B)
where B: BufMut + AsMut<[u8]>,

Compresses data to a given buffer.
§

fn uncompressable_ref(&self) -> Option<&[u8]>

If the type cannot be compressed, return its inner reference as Some(self.as_ref())
§

fn compress(self) -> Self::Compressed

Compresses data going into the database.
§

impl Debug for Address

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decodable for Address

§

fn decode(buf: &mut &[u8]) -> Result<Address, Error>

Decodes the blob into the appropriate type. buf must be advanced past the decoded object.
§

impl Decode for Address

§

fn decode<B>(value: B) -> Result<Address, DatabaseError>
where B: AsRef<[u8]>,

Decodes data coming from the database.
§

impl Decompress for Address

§

fn decompress<B>(value: B) -> Result<Address, DatabaseError>
where B: AsRef<[u8]>,

Decompresses data coming from the database.
§

fn decompress_owned(value: Vec<u8>) -> Result<Self, DatabaseError>

Decompresses owned data coming from the database.
§

impl Default for Address

§

fn default() -> Address

Returns the “default value” for a type. Read more
§

impl Deref for Address

§

type Target = FixedBytes<20>

The resulting type after dereferencing.
§

fn deref(&self) -> &<Address as Deref>::Target

Dereferences the value.
§

impl DerefMut for Address

§

fn deref_mut(&mut self) -> &mut <Address as Deref>::Target

Mutably dereferences the value.
§

impl<'de> Deserialize<'de> for Address

§

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 Display for Address

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Distribution<Address> for Standard

§

fn sample<R>(&self, rng: &mut R) -> Address
where R: Rng + ?Sized,

Generate a random value of T, using rng as the source of randomness.
source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
§

impl Encodable for Address

§

fn length(&self) -> usize

Returns the length of the encoding of this type in bytes. Read more
§

fn encode(&self, out: &mut dyn BufMut)

Encodes the type into the out buffer.
§

impl Encode for Address

§

type Encoded = [u8; 20]

Encoded type.
§

fn encode(self) -> <Address as Encode>::Encoded

Encodes data going into the database.
§

impl<'a> From<&'a [u8; 20]> for &'a Address

§

fn from(value: &'a [u8; 20]) -> &'a Address

Converts to this type from the input type.
§

impl<'a> From<&'a [u8; 20]> for Address

§

fn from(value: &'a [u8; 20]) -> Address

Converts to this type from the input type.
§

impl<'a> From<&'a Address> for &'a [u8; 20]

§

fn from(value: &'a Address) -> &'a [u8; 20]

Converts to this type from the input type.
§

impl<'a> From<&'a mut [u8; 20]> for &'a Address

§

fn from(value: &'a mut [u8; 20]) -> &'a Address

Converts to this type from the input type.
§

impl<'a> From<&'a mut [u8; 20]> for &'a mut Address

§

fn from(value: &'a mut [u8; 20]) -> &'a mut Address

Converts to this type from the input type.
§

impl<'a> From<&'a mut [u8; 20]> for Address

§

fn from(value: &'a mut [u8; 20]) -> Address

Converts to this type from the input type.
§

impl<'a> From<&'a mut Address> for &'a [u8; 20]

§

fn from(value: &'a mut Address) -> &'a [u8; 20]

Converts to this type from the input type.
§

impl<'a> From<&'a mut Address> for &'a mut [u8; 20]

§

fn from(value: &'a mut Address) -> &'a mut [u8; 20]

Converts to this type from the input type.
§

impl From<[u8; 20]> for Address

§

fn from(value: [u8; 20]) -> Address

Converts to this type from the input type.
§

impl From<Address> for [u8; 20]

§

fn from(value: Address) -> [u8; 20]

Converts to this type from the input type.
§

impl From<Address> for DynSolValue

§

fn from(value: Address) -> DynSolValue

Converts to this type from the input type.
§

impl From<Address> for FixedBytes<20>

§

fn from(original: Address) -> FixedBytes<20>

Converts to this type from the input type.
§

impl From<Address> for TxKind

§

fn from(value: Address) -> TxKind

Creates a TxKind::Call with the given address.

§

impl From<Address> for Uint<160, 3>

§

fn from(value: Address) -> Uint<160, 3>

Converts to this type from the input type.
§

impl From<Address> for ValueOrArray<Address>

§

fn from(src: Address) -> ValueOrArray<Address>

Converts to this type from the input type.
§

impl From<FixedBytes<20>> for Address

§

fn from(original: FixedBytes<20>) -> Address

Converts to this type from the input type.
§

impl From<Uint<160, 3>> for Address

§

fn from(value: Uint<160, 3>) -> Address

Converts to this type from the input type.
§

impl FromHex for Address

§

type Error = FromHexError

The associated error which can be returned from parsing.
§

fn from_hex<T>(hex: T) -> Result<Address, <Address as FromHex>::Error>
where T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails with a custom error type. Read more
§

impl FromStr for Address

§

type Err = <FixedBytes<20> as FromStr>::Err

The associated error which can be returned from parsing.
§

fn from_str(src: &str) -> Result<Address, <Address as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for Address

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<__IdxT> Index<__IdxT> for Address
where FixedBytes<20>: Index<__IdxT>,

§

type Output = <FixedBytes<20> as Index<__IdxT>>::Output

The returned type after indexing.
§

fn index(&self, idx: __IdxT) -> &<Address as Index<__IdxT>>::Output

Performs the indexing (container[index]) operation. Read more
§

impl<__IdxT> IndexMut<__IdxT> for Address
where FixedBytes<20>: IndexMut<__IdxT>,

§

fn index_mut(&mut self, idx: __IdxT) -> &mut <Address as Index<__IdxT>>::Output

Performs the mutable indexing (container[index]) operation. Read more
§

impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime Address

§

type Item = <&'__deriveMoreLifetime FixedBytes<20> as IntoIterator>::Item

The type of the elements being iterated over.
§

type IntoIter = <&'__deriveMoreLifetime FixedBytes<20> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <&'__deriveMoreLifetime Address as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime mut Address

§

type Item = <&'__deriveMoreLifetime mut FixedBytes<20> as IntoIterator>::Item

The type of the elements being iterated over.
§

type IntoIter = <&'__deriveMoreLifetime mut FixedBytes<20> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
§

fn into_iter( self, ) -> <&'__deriveMoreLifetime mut Address as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl IntoIterator for Address

§

type Item = <FixedBytes<20> as IntoIterator>::Item

The type of the elements being iterated over.
§

type IntoIter = <FixedBytes<20> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <Address as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl LowerHex for Address

§

fn fmt( &self, _derive_more_display_formatter: &mut Formatter<'_>, ) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl MaxEncodedLenAssoc for Address

§

const LEN: usize = 21usize

The maximum length.
§

impl Not for Address

§

type Output = Address

The resulting type after applying the ! operator.
§

fn not(self) -> Address

Performs the unary ! operation. Read more
§

impl Ord for Address

§

fn cmp(&self, other: &Address) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq<&[u8]> for Address

§

fn eq(&self, other: &&[u8]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&[u8; 20]> for Address

§

fn eq(&self, other: &&[u8; 20]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&Address> for [u8]

§

fn eq(&self, other: &&Address) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&Address> for [u8; 20]

§

fn eq(&self, other: &&Address) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<[u8]> for &Address

§

fn eq(&self, other: &[u8]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<[u8]> for Address

§

fn eq(&self, other: &[u8]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<[u8; 20]> for &Address

§

fn eq(&self, other: &[u8; 20]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<[u8; 20]> for Address

§

fn eq(&self, other: &[u8; 20]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Address> for &[u8]

§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Address> for &[u8; 20]

§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Address> for [u8]

§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Address> for [u8; 20]

§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq for Address

§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd<&[u8]> for Address

§

fn partial_cmp(&self, other: &&[u8]) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PartialOrd<&Address> for [u8]

§

fn partial_cmp(&self, other: &&Address) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PartialOrd<[u8]> for &Address

§

fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PartialOrd<[u8]> for Address

§

fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PartialOrd<Address> for &[u8]

§

fn partial_cmp(&self, other: &Address) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PartialOrd<Address> for [u8]

§

fn partial_cmp(&self, other: &Address) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PartialOrd for Address

§

fn partial_cmp(&self, other: &Address) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Serialize for Address

§

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 SolValue for Address

§

type SolType = Address

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Self
where Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>
where Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( data: &'de [u8], validate: bool, ) -> Result<Self, Error>
where Self: From<<Self::SolType as SolType>::RustType>, <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( data: &'de [u8], validate: bool, ) -> Result<Self, Error>
where Self: From<<Self::SolType as SolType>::RustType>, <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

impl<'a> TryFrom<&'a [u8]> for &'a Address

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
§

fn try_from( slice: &'a [u8], ) -> Result<&'a Address, <&'a Address as TryFrom<&'a [u8]>>::Error>

Performs the conversion.
§

impl TryFrom<&[u8]> for Address

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
§

fn try_from(slice: &[u8]) -> Result<Address, <Address as TryFrom<&[u8]>>::Error>

Performs the conversion.
§

impl<'a> TryFrom<&'a mut [u8]> for &'a mut Address

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
§

fn try_from( slice: &'a mut [u8], ) -> Result<&'a mut Address, <&'a mut Address as TryFrom<&'a mut [u8]>>::Error>

Performs the conversion.
§

impl TryFrom<&mut [u8]> for Address

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
§

fn try_from( slice: &mut [u8], ) -> Result<Address, <Address as TryFrom<&mut [u8]>>::Error>

Performs the conversion.
§

impl UpperHex for Address

§

fn fmt( &self, _derive_more_display_formatter: &mut Formatter<'_>, ) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Copy for Address

§

impl Eq for Address

§

impl MaxEncodedLen<alloy_primitives::::bits::address::{impl#94}::{constant#0}> for Address

§

impl StructuralPartialEq for Address

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<A, T> AsBits<T> for A
where A: AsRef<[T]>, T: BitStore,

§

fn as_bits<O>(&self) -> &BitSlice<T, O>
where O: BitOrder,

Views self as an immutable bit-slice region with the O ordering.
§

fn try_as_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>
where O: BitOrder,

Attempts to view self as an immutable bit-slice region with the O ordering. Read more
§

impl<T, U> AsByteSlice<T> for U
where T: ToByteSlice, U: AsRef<[T]> + ?Sized,

§

fn as_byte_slice(&self) -> &[u8]

§

impl<A, T> AsMutBits<T> for A
where A: AsMut<[T]>, T: BitStore,

§

fn as_mut_bits<O>(&mut self) -> &mut BitSlice<T, O>
where O: BitOrder,

Views self as a mutable bit-slice region with the O ordering.
§

fn try_as_mut_bits<O>(&mut self) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>
where O: BitOrder,

Attempts to view self as a mutable bit-slice region with the O ordering. Read more
§

impl<T, U> AsMutByteSlice<T> for U
where T: ToMutByteSlice, U: AsMut<[T]> + ?Sized,

§

fn as_mut_byte_slice(&mut self) -> &mut [u8]

§

impl<U> AsMutSliceOf for U
where U: AsMut<[u8]> + ?Sized,

§

fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>
where T: FromByteSlice,

§

impl<U> AsSliceOf for U
where U: AsRef<[u8]> + ?Sized,

§

fn as_slice_of<T>(&self) -> Result<&[T], Error>
where T: FromByteSlice,

§

impl<I> BidiIterator for I

§

fn bidi(self, cond: bool) -> Bidi<Self::IntoIter>

Conditionally reverses the direction of iteration. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pipe for T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> ToCompactString for T
where T: Display,

§

fn to_compact_string(&self) -> CompactString

Converts the given value to a [CompactString]. Read more
§

impl<T> ToHex for T
where T: AsRef<[u8]>,

§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

👎Deprecated: use ToHexExt instead
Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca).
§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

👎Deprecated: use ToHexExt instead
Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA).
source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
§

impl<T> ToHexExt for T
where T: AsRef<[u8]>,

§

fn encode_hex(&self) -> String

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca).
§

fn encode_hex_upper(&self) -> String

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA).
§

fn encode_hex_with_prefix(&self) -> String

Encode the hex strict representing self into the result with prefix 0x. Lower case letters are used (e.g. 0xf9b4ca).
§

fn encode_hex_upper_with_prefix(&self) -> String

Encode the hex strict representing self into the result with prefix 0X. Upper case letters are used (e.g. 0xF9B4CA).
§

impl<T> ToLine for T
where T: Display,

§

fn to_line(&self) -> Line<'_>

Converts the value to a [Line].
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToSpan for T
where T: Display,

§

fn to_span(&self) -> Span<'_>

Converts the value to a [Span].
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

§

impl<'a, T> ToText<'a> for T
where T: Display,

§

fn to_text(&self) -> Text<'a>

Converts the value to a [Text].
§

impl<T> TryClone for T
where T: Clone,

§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<A> ArbInterop for A
where A: for<'a> Arbitrary<'a> + 'static + Debug + Clone,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Key for T
where T: Encode + Decode + Ord + Clone + Serialize + for<'a> Deserialize<'a>,

§

impl<T> MaybeDebug for T
where T: Debug,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSendSync for T

§

impl<T> NippyJarHeader for T
where T: Send + Sync + Serialize + for<'b> Deserialize<'b> + Debug + 'static,

source§

impl<T> NumBytes for T
where T: Debug + AsRef<[u8]> + AsMut<[u8]> + PartialEq + Eq + PartialOrd + Ord + Hash + Borrow<[u8]> + BorrowMut<[u8]> + ?Sized,

§

impl<T> PHFKey for T
where T: AsRef<[u8]> + Sync + Clone + Hash,

§

impl<T> RpcObject for T
where T: RpcParam + RpcReturn,

§

impl<T> RpcParam for T
where T: Serialize + Clone + Debug + Send + Sync + Unpin,

§

impl<T> RpcReturn for T
where T: DeserializeOwned + Debug + Send + Sync + Unpin + 'static,

§

impl<T> Value for T
where T: Compress + Decompress + Serialize,

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