#[repr(transparent)]
pub struct FixedBytes<const N: usize>(pub [u8; N]);
Expand description

A byte array of fixed length ([u8; N]).

This type allows us to more tightly control serialization, deserialization. rlp encoding, decoding, and other type-level attributes for fixed-length byte arrays.

Users looking to prevent type-confusion between byte arrays of different lengths should use the wrap_fixed_bytes! macro to create a new fixed-length byte array type.

Tuple Fields§

§0: [u8; N]

Implementations§

source§

impl<const N: usize> FixedBytes<N>

source

pub const ZERO: FixedBytes<N> = _

Array of Zero bytes.

source

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

Wraps the given byte array in FixedBytes.

source

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

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

source

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

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

source

pub const fn len_bytes() -> usize

Returns the size of this byte array (N).

source

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.

source

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

Create a new FixedBytes from the given slice src.

§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.

source

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.

source

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.

source

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

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

source

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

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

source

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

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

source

pub const fn const_covers(self, other: FixedBytes<N>) -> bool

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

source

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

Compile-time equality. NOT constant-time equality.

source

pub fn is_zero(&self) -> bool

Returns true if no bits are set.

source

pub const fn const_is_zero(&self) -> bool

Returns true if no bits are set.

source

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

Computes the bitwise AND of two FixedBytes.

source

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

Computes the bitwise OR of two FixedBytes.

source

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

Computes the bitwise XOR of two FixedBytes.

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

source

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

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

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)

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.78.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.78.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)

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)

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)

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)

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<'arbitrary, const N: usize> Arbitrary<'arbitrary> for FixedBytes<N>

source§

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

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

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

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

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

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

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

source§

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

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

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

source§

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

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

impl AsMut<FixedBytes<20>> for Address

source§

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

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

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

source§

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

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

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

source§

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

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

impl AsRef<FixedBytes<20>> for Address

source§

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

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

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

§

type Output = FixedBytes<N>

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

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

source§

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

Performs the &= operation. Read more
source§

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

§

type Output = FixedBytes<N>

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

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

source§

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

Performs the |= operation. Read more
source§

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

§

type Output = FixedBytes<N>

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

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

source§

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

Performs the ^= operation. Read more
source§

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

source§

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

Immutably borrows from an owned value. Read more
source§

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

source§

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

Immutably borrows from an owned value. Read more
source§

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

source§

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

Immutably borrows from an owned value. Read more
source§

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

source§

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

Immutably borrows from an owned value. Read more
source§

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

source§

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

Immutably borrows from an owned value. Read more
source§

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

source§

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

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

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

source§

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

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

source§

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

Formats the value using the given formatter. Read more
source§

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

source§

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

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

impl<'a, const N: usize> Default for &'a FixedBytes<N>

source§

fn default() -> &'a FixedBytes<N>

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

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

source§

fn default() -> FixedBytes<N>

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

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

§

type Target = [u8; N]

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

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

source§

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

Mutably dereferences the value.
source§

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

source§

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

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

source§

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

Formats the value using the given formatter. Read more
source§

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

source§

fn length(&self) -> usize

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

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

Encodes the type into the out buffer.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl From<Address> for FixedBytes<20>

source§

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

Converts to this type from the input type.
source§

impl From<Bloom> for FixedBytes<256>

source§

fn from(original: Bloom) -> FixedBytes<256>

Converts to this type from the input type.
source§

impl From<FixedBytes<1>> for Signed<8, 1>

source§

fn from(value: FixedBytes<1>) -> Signed<8, 1>

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

source§

impl From<FixedBytes<1>> for Uint<8, 1>

source§

fn from(value: FixedBytes<1>) -> Uint<8, 1>

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

source§

impl From<FixedBytes<16>> for Signed<128, 2>

source§

fn from(value: FixedBytes<16>) -> Signed<128, 2>

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

source§

impl From<FixedBytes<16>> for Uint<128, 2>

source§

fn from(value: FixedBytes<16>) -> Uint<128, 2>

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

source§

impl From<FixedBytes<2>> for Signed<16, 1>

source§

fn from(value: FixedBytes<2>) -> Signed<16, 1>

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

source§

impl From<FixedBytes<2>> for Uint<16, 1>

source§

fn from(value: FixedBytes<2>) -> Uint<16, 1>

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

source§

impl From<FixedBytes<20>> for Address

source§

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

Converts to this type from the input type.
source§

impl From<FixedBytes<20>> for Signed<160, 3>

source§

fn from(value: FixedBytes<20>) -> Signed<160, 3>

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

source§

impl From<FixedBytes<20>> for Uint<160, 3>

source§

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

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

source§

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

source§

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

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

source§

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

source§

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

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

source§

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

source§

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

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

source§

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

source§

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

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

source§

impl From<FixedBytes<64>> for Signed<512, 8>

source§

fn from(value: FixedBytes<64>) -> Signed<512, 8>

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

source§

impl From<FixedBytes<64>> for Uint<512, 8>

source§

fn from(value: FixedBytes<64>) -> Uint<512, 8>

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

source§

impl From<FixedBytes<8>> for Signed<64, 1>

source§

fn from(value: FixedBytes<8>) -> Signed<64, 1>

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

source§

impl From<FixedBytes<8>> for Uint<64, 1>

source§

fn from(value: FixedBytes<8>) -> Uint<64, 1>

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

source§

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

source§

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

Converts to this type from the input type.
source§

impl From<Function> for FixedBytes<24>

source§

fn from(original: Function) -> FixedBytes<24>

Converts to this type from the input type.
source§

impl From<Signed<128, 2>> for FixedBytes<16>

source§

fn from(value: Signed<128, 2>) -> FixedBytes<16>

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

source§

impl From<Signed<16, 1>> for FixedBytes<2>

source§

fn from(value: Signed<16, 1>) -> FixedBytes<2>

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

source§

impl From<Signed<160, 3>> for FixedBytes<20>

source§

fn from(value: Signed<160, 3>) -> FixedBytes<20>

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

source§

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

source§

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.

source§

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

source§

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

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

source§

impl From<Signed<512, 8>> for FixedBytes<64>

source§

fn from(value: Signed<512, 8>) -> FixedBytes<64>

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

source§

impl From<Signed<64, 1>> for FixedBytes<8>

source§

fn from(value: Signed<64, 1>) -> FixedBytes<8>

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

source§

impl From<Signed<8, 1>> for FixedBytes<1>

source§

fn from(value: Signed<8, 1>) -> FixedBytes<1>

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

source§

impl From<Uint<128, 2>> for FixedBytes<16>

source§

fn from(value: Uint<128, 2>) -> FixedBytes<16>

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

source§

impl From<Uint<16, 1>> for FixedBytes<2>

source§

fn from(value: Uint<16, 1>) -> FixedBytes<2>

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

source§

impl From<Uint<160, 3>> for FixedBytes<20>

source§

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

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

source§

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

source§

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.

source§

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

source§

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

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

source§

impl From<Uint<512, 8>> for FixedBytes<64>

source§

fn from(value: Uint<512, 8>) -> FixedBytes<64>

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

source§

impl From<Uint<64, 1>> for FixedBytes<8>

source§

fn from(value: Uint<64, 1>) -> FixedBytes<8>

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

source§

impl From<Uint<8, 1>> for FixedBytes<1>

source§

fn from(value: Uint<8, 1>) -> FixedBytes<1>

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

source§

impl From<i128> for FixedBytes<16>

source§

fn from(value: i128) -> FixedBytes<16>

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

source§

impl From<i16> for FixedBytes<2>

source§

fn from(value: i16) -> FixedBytes<2>

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

source§

impl From<i32> for FixedBytes<4>

source§

fn from(value: i32) -> FixedBytes<4>

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

source§

impl From<i64> for FixedBytes<8>

source§

fn from(value: i64) -> FixedBytes<8>

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

source§

impl From<i8> for FixedBytes<1>

source§

fn from(value: i8) -> FixedBytes<1>

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

source§

impl From<u128> for FixedBytes<16>

source§

fn from(value: u128) -> FixedBytes<16>

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

source§

impl From<u16> for FixedBytes<2>

source§

fn from(value: u16) -> FixedBytes<2>

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

source§

impl From<u32> for FixedBytes<4>

source§

fn from(value: u32) -> FixedBytes<4>

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

source§

impl From<u64> for FixedBytes<8>

source§

fn from(value: u64) -> FixedBytes<8>

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

source§

impl From<u8> for FixedBytes<1>

source§

fn from(value: u8) -> FixedBytes<1>

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

source§

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

§

type Error = FromHexError

The associated error which can be returned from parsing.
source§

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

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

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

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

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

source§

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

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

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

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

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

source§

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

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

impl<'__deriveMoreLifetime, const N: usize> IntoIterator for &'__deriveMoreLifetime FixedBytes<N>

§

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

The type of the elements being iterated over.
§

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

Which kind of iterator are we turning this into?
source§

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

Creates an iterator from a value. Read more
source§

impl<'__deriveMoreLifetime, const N: usize> IntoIterator for &'__deriveMoreLifetime mut FixedBytes<N>

§

type Item = <&'__deriveMoreLifetime mut [u8; N] as IntoIterator>::Item

The type of the elements being iterated over.
§

type IntoIter = <&'__deriveMoreLifetime mut [u8; N] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
source§

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

Creates an iterator from a value. Read more
source§

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

§

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

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

Creates an iterator from a value. Read more
source§

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

source§

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

Formats the value using the given formatter.
source§

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

source§

const LEN: usize = _

The maximum length.
source§

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

source§

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 + PartialOrd,

Restrict a value to a certain interval. Read more
source§

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

source§

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

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

source§

fn eq(&self, other: &&[u8; N]) -> 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.
source§

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

source§

fn eq(&self, other: &&FixedBytes<N>) -> 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.
source§

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

source§

fn eq(&self, other: &&FixedBytes<N>) -> 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.
source§

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

source§

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

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

source§

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

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

source§

fn eq(&self, other: &[u8; N]) -> 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.
source§

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

source§

fn eq(&self, other: &[u8; N]) -> 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.
source§

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

source§

fn eq(&self, other: &FixedBytes<N>) -> 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.
source§

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

source§

fn eq(&self, other: &FixedBytes<N>) -> 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.
source§

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

source§

fn eq(&self, other: &FixedBytes<N>) -> 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.
source§

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

source§

fn eq(&self, other: &FixedBytes<N>) -> 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.
source§

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

source§

fn eq(&self, other: &FixedBytes<N>) -> 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.
source§

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

source§

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

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

source§

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

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

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

source§

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

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

source§

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

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

source§

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

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

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

source§

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

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

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

source§

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

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

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

source§

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

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

Tries to create a ref 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.
source§

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

Performs the conversion.
source§

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

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

Performs the conversion.
source§

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

Tries to create a ref 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.
source§

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

Performs the conversion.
source§

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

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

Performs the conversion.
source§

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

source§

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

Formats the value using the given formatter.
source§

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

source§

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

source§

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

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#11}::{constant#0}> for FixedBytes<64>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#12}::{constant#0}> for FixedBytes<128>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#13}::{constant#0}> for FixedBytes<256>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#14}::{constant#0}> for FixedBytes<512>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#15}::{constant#0}> for FixedBytes<1024>

source§

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

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#4}::{constant#0}> for FixedBytes<1>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#5}::{constant#0}> for FixedBytes<2>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#6}::{constant#0}> for FixedBytes<4>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#7}::{constant#0}> for FixedBytes<8>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#8}::{constant#0}> for FixedBytes<16>

source§

impl MaxEncodedLen<alloy_primitives::::bits::rlp::{impl#9}::{constant#0}> for FixedBytes<20>

source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

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

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

source§

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

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

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

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

source§

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

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

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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

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

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.

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.

§

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.
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.
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> ToHex for T
where T: AsRef<[u8]>,

§

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

👎Deprecated: use encode or other specialized functions 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 encode or other specialized functions instead
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).
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
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> 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

source§

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