Type Alias B256

pub type B256 = FixedBytes<32>;
Expand description

32-byte fixed byte-array type.

Aliased Type§

struct B256(pub [u8; 32]);

Fields§

§0: [u8; 32]

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: 32 bytes

Implementations

§

impl<const N: usize> FixedBytes<N>

pub const ZERO: FixedBytes<N>

Array of Zero bytes.

pub const fn new(bytes: [u8; N]) -> FixedBytes<N>

Wraps the given byte array in FixedBytes.

pub const fn with_last_byte(x: u8) -> FixedBytes<N>

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

pub const fn repeat_byte(byte: u8) -> FixedBytes<N>

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

pub const fn len_bytes() -> usize

Returns the size of this byte array (N).

pub fn random() -> FixedBytes<N>

Available on crate feature getrandom only.

Creates a new FixedBytes 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.

pub fn try_random() -> Result<FixedBytes<N>, Error>

Available on crate feature getrandom only.

Tries to create a new FixedBytes with the default cryptographic random number generator.

See random for more details.

pub fn random_with<R>(rng: &mut R) -> FixedBytes<N>
where R: RngCore + ?Sized,

Available on crate feature rand only.

Creates a new FixedBytes with the given random number generator.

See random for more details.

pub fn randomize(&mut self)

Available on crate feature getrandom only.

Fills this FixedBytes with the default cryptographic random number generator.

See random for more details.

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

Available on crate feature getrandom only.

Tries to fill this FixedBytes with the default cryptographic random number generator.

See random for more details.

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

Available on crate feature rand only.

Fills this FixedBytes with the given random number generator.

pub const fn concat_const<const M: usize, const Z: usize>( self, other: FixedBytes<M>, ) -> FixedBytes<Z>

Concatenate two FixedBytes.

Due to constraints in the language, the user must specify the value of the output size Z.

§Panics

Panics if Z is not equal to N + M.

pub fn from_slice(src: &[u8]) -> FixedBytes<N>

Create a new FixedBytes 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]) -> FixedBytes<N>

Create a new FixedBytes 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]) -> FixedBytes<N>

Create a new FixedBytes 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 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 const fn const_covers(self, other: FixedBytes<N>) -> bool

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

pub const 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 const fn const_is_zero(&self) -> bool

Returns true if no bits are set.

pub const fn bit_and(self, rhs: FixedBytes<N>) -> FixedBytes<N>

Computes the bitwise AND of two FixedBytes.

pub const fn bit_or(self, rhs: FixedBytes<N>) -> FixedBytes<N>

Computes the bitwise OR of two FixedBytes.

pub const fn bit_xor(self, rhs: FixedBytes<N>) -> FixedBytes<N>

Computes the bitwise XOR of two FixedBytes.

Trait Implementations

§

impl<'arbitrary, const N: usize> Arbitrary<'arbitrary> for FixedBytes<N>

§

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

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

fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<FixedBytes<N>, 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
§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

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

impl<const N: usize> Arbitrary for FixedBytes<N>

§

type Parameters = <[u8; N] as Arbitrary>::Parameters

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

type Strategy = Map<<[u8; N] as Arbitrary>::Strategy, fn(_: [u8; N]) -> FixedBytes<N>>

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

fn arbitrary_with( _top: <FixedBytes<N> as Arbitrary>::Parameters, ) -> <FixedBytes<N> 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
§

fn arbitrary() -> Self::Strategy

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

impl<const N: usize> AsMut<[u8]> for FixedBytes<N>

§

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

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

impl<const N: usize> AsMut<[u8; N]> for FixedBytes<N>

§

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

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

impl<const N: usize> AsRef<[u8]> for FixedBytes<N>

§

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

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

impl<const N: usize> AsRef<[u8; N]> for FixedBytes<N>

§

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

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

impl<const N: usize> BitAnd for FixedBytes<N>

§

type Output = FixedBytes<N>

The resulting type after applying the & operator.
§

fn bitand(self, rhs: FixedBytes<N>) -> <FixedBytes<N> as BitAnd>::Output

Performs the & operation. Read more
§

impl<const N: usize> BitAndAssign for FixedBytes<N>

§

fn bitand_assign(&mut self, rhs: FixedBytes<N>)

Performs the &= operation. Read more
§

impl<const N: usize> BitOr for FixedBytes<N>

§

type Output = FixedBytes<N>

The resulting type after applying the | operator.
§

fn bitor(self, rhs: FixedBytes<N>) -> <FixedBytes<N> as BitOr>::Output

Performs the | operation. Read more
§

impl<const N: usize> BitOrAssign for FixedBytes<N>

§

fn bitor_assign(&mut self, rhs: FixedBytes<N>)

Performs the |= operation. Read more
§

impl<const N: usize> BitXor for FixedBytes<N>

§

type Output = FixedBytes<N>

The resulting type after applying the ^ operator.
§

fn bitxor(self, rhs: FixedBytes<N>) -> <FixedBytes<N> as BitXor>::Output

Performs the ^ operation. Read more
§

impl<const N: usize> BitXorAssign for FixedBytes<N>

§

fn bitxor_assign(&mut self, rhs: FixedBytes<N>)

Performs the ^= operation. Read more
§

impl<const N: usize> Borrow<[u8]> for FixedBytes<N>

§

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

Immutably borrows from an owned value. Read more
§

impl<const N: usize> Borrow<[u8; N]> for FixedBytes<N>

§

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

Immutably borrows from an owned value. Read more
§

impl<const N: usize> BorrowMut<[u8]> for FixedBytes<N>

§

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

Mutably borrows from an owned value. Read more
§

impl<const N: usize> BorrowMut<[u8; N]> for FixedBytes<N>

§

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

Mutably borrows from an owned value. Read more
§

impl<const N: usize> Clone for FixedBytes<N>

§

fn clone(&self) -> FixedBytes<N>

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<const N: usize> Compact for FixedBytes<N>

§

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) -> (FixedBytes<N>, &[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 FixedBytes<32>

§

type Compressed = Vec<u8>

Compressed type.
§

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

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

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

Compresses data to a given buffer.
§

fn compress(self) -> Self::Compressed

Compresses data going into the database.
§

impl<const N: usize> Debug for FixedBytes<N>

§

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

Formats the value using the given formatter. Read more
§

impl<const N: usize> Decodable for FixedBytes<N>

§

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

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

impl Decode for FixedBytes<32>

§

fn decode(value: &[u8]) -> Result<FixedBytes<32>, DatabaseError>

Decodes data coming from the database.
§

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

Decodes owned data coming from the database.
§

impl<const N: usize> Decode for FixedBytes<N>

§

fn is_ssz_fixed_len() -> bool

Returns true if this object has a fixed-length. Read more
§

fn ssz_fixed_len() -> usize

The number of bytes this object occupies in the fixed-length portion of the SSZ bytes. Read more
§

fn from_ssz_bytes(bytes: &[u8]) -> Result<FixedBytes<N>, DecodeError>

Attempts to decode Self from bytes, returning a DecodeError on failure. Read more
§

impl Decompress for FixedBytes<32>

§

fn decompress(value: &[u8]) -> Result<FixedBytes<32>, DatabaseError>

Decompresses data coming from the database.
§

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

Decompresses owned data coming from the database.
§

impl<const N: usize> Default for FixedBytes<N>

§

fn default() -> FixedBytes<N>

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

impl<const N: usize> Deref for FixedBytes<N>

§

type Target = [u8; N]

The resulting type after dereferencing.
§

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

Dereferences the value.
§

impl<const N: usize> DerefMut for FixedBytes<N>

§

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

Mutably dereferences the value.
§

impl<'de, const N: usize> Deserialize<'de> for FixedBytes<N>

§

fn deserialize<D>( deserializer: D, ) -> Result<FixedBytes<N>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<const N: usize> Display for FixedBytes<N>

§

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

Formats the value using the given formatter. Read more
§

impl<const N: usize> Encodable for FixedBytes<N>

§

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 FixedBytes<32>

§

type Encoded = [u8; 32]

Encoded type.
§

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

Encodes data going into the database.
§

impl<const N: usize> Encode for FixedBytes<N>

§

fn is_ssz_fixed_len() -> bool

Returns true if this object has a fixed-length. Read more
§

fn ssz_bytes_len(&self) -> usize

Returns the size (in bytes) when self is serialized. Read more
§

fn ssz_fixed_len() -> usize

The number of bytes this object occupies in the fixed-length portion of the SSZ bytes. Read more
§

fn ssz_append(&self, buf: &mut Vec<u8>)

Append the encoding self to buf. Read more
§

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

Returns the full-form encoding of this object. Read more
§

impl<const N: usize> From<&[u8; N]> for FixedBytes<N>

§

fn from(bytes: &[u8; N]) -> FixedBytes<N>

Converts to this type from the input type.
§

impl<const N: usize> From<&mut [u8; N]> for FixedBytes<N>

§

fn from(bytes: &mut [u8; N]) -> FixedBytes<N>

Converts to this type from the input type.
§

impl<const N: usize> From<[u8; N]> for FixedBytes<N>

§

fn from(value: [u8; N]) -> FixedBytes<N>

Converts to this type from the input type.
§

impl From<RpcBlockHash> for FixedBytes<32>

§

fn from(value: RpcBlockHash) -> FixedBytes<32>

Converts to this type from the input type.
§

impl From<Signed<256, 4>> for FixedBytes<32>

§

fn from(value: Signed<256, 4>) -> FixedBytes<32>

Converts a fixed-width unsigned integer into a fixed byte array by interpreting the bytes as big-endian.

§

impl From<Uint<256, 4>> for FixedBytes<32>

§

fn from(value: Uint<256, 4>) -> FixedBytes<32>

Converts a fixed-width unsigned integer into a fixed byte array by interpreting the bytes as big-endian.

§

impl From<WordToken> for FixedBytes<32>

§

fn from(value: WordToken) -> FixedBytes<32>

Converts to this type from the input type.
§

impl<const N: usize> FromHex for FixedBytes<N>

§

type Error = FromHexError

The associated error which can be returned from parsing.
§

fn from_hex<T>( hex: T, ) -> Result<FixedBytes<N>, <FixedBytes<N> 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<const N: usize> FromStr for FixedBytes<N>

§

type Err = FromHexError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<FixedBytes<N>, <FixedBytes<N> as FromStr>::Err>

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

impl<const N: usize> Hash for FixedBytes<N>

§

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 InMemorySize for FixedBytes<32>

§

fn size(&self) -> usize

Returns a heuristic for the in-memory size of a struct.
§

impl<__IdxT, const N: usize> Index<__IdxT> for FixedBytes<N>
where [u8; N]: Index<__IdxT>,

§

type Output = <[u8; N] as Index<__IdxT>>::Output

The returned type after indexing.
§

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

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

impl<__IdxT, const N: usize> IndexMut<__IdxT> for FixedBytes<N>
where [u8; N]: IndexMut<__IdxT>,

§

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

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

impl<const N: usize> IntoIterator for FixedBytes<N>
where [u8; N]: IntoIterator,

§

type Item = <[u8; N] as IntoIterator>::Item

The type of the elements being iterated over.
§

type IntoIter = <[u8; N] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
§

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

Creates an iterator from a value. Read more
§

impl IntoU256 for FixedBytes<32>

§

fn into_u256(self) -> Uint<256, 4>

§

impl<const N: usize> LowerHex for FixedBytes<N>

§

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

Formats the value using the given formatter. Read more
§

impl<const N: usize> MaxEncodedLenAssoc for FixedBytes<N>

§

const LEN: usize

The maximum length.
§

impl<const N: usize> Not for FixedBytes<N>

§

type Output = FixedBytes<N>

The resulting type after applying the ! operator.
§

fn not(self) -> <FixedBytes<N> as Not>::Output

Performs the unary ! operation. Read more
§

impl<const N: usize> Ord for FixedBytes<N>

§

fn cmp(&self, other: &FixedBytes<N>) -> 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,

Restrict a value to a certain interval. Read more
§

impl<const N: usize> PartialEq<&[u8]> for FixedBytes<N>

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl<const N: usize> PartialEq<&[u8; N]> for FixedBytes<N>

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl<const N: usize> PartialEq<[u8]> for FixedBytes<N>

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl<const N: usize> PartialEq<[u8; N]> for FixedBytes<N>

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl<const N: usize> PartialEq for FixedBytes<N>

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl<const N: usize> PartialOrd<&[u8]> for FixedBytes<N>

§

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

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

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

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

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

impl<const N: usize> PartialOrd<[u8]> for FixedBytes<N>

§

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

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

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

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

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

impl<const N: usize> PartialOrd for FixedBytes<N>

§

fn partial_cmp(&self, other: &FixedBytes<N>) -> 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

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

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

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

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

impl<const N: usize> Serialize for FixedBytes<N>

§

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<const N: usize> SolValue for FixedBytes<N>
where ByteCount<N>: SupportedFixedBytes,

§

type SolType = FixedBytes<N>

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_encode_sequence(&self) -> Vec<u8>
where <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence. Read more
§

fn abi_encode_params(&self) -> Vec<u8>
where <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence suitable for function parameters. 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<const N: usize> TreeHash for FixedBytes<N>

§

fn tree_hash_type() -> TreeHashType

§

fn tree_hash_packed_encoding(&self) -> SmallVec<[u8; 32]>

§

fn tree_hash_packing_factor() -> usize

§

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

§

impl<const N: usize> TryFrom<&[u8]> for FixedBytes<N>

Tries to create a FixedBytes<N> by copying from a slice &[u8]. Succeeds if slice.len() == N.

§

type Error = TryFromSliceError

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

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

Performs the conversion.
§

impl<const N: usize> TryFrom<&mut [u8]> for FixedBytes<N>

Tries to create a FixedBytes<N> by copying from a mutable slice &mut [u8]. Succeeds if slice.len() == N.

§

type Error = TryFromSliceError

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

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

Performs the conversion.
§

impl<const N: usize> UpperHex for FixedBytes<N>

§

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

Formats the value using the given formatter. Read more
§

impl<const N: usize> Copy for FixedBytes<N>

§

impl<const N: usize> Eq for FixedBytes<N>

§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#10}::{constant#0}> for FixedBytes<32>

§

impl<const N: usize> StructuralPartialEq for FixedBytes<N>