Skip to main content

Function

Struct Function 

Source
#[repr(transparent)]
pub struct Function(pub FixedBytes<24>);
Expand description

An Ethereum ABI function pointer, 24 bytes in length.

An address (20 bytes), followed by a function selector (4 bytes). Encoded identical to bytes24.

Tuple Fields§

§0: FixedBytes<24>

Implementations§

Source§

impl Function

Source

pub const ZERO: Function

Array of Zero bytes.

Source

pub const fn new(bytes: [u8; 24]) -> Function

Wraps the given byte array in this type.

Source

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

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

Source

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

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

Source

pub const fn len_bytes() -> usize

Returns the size of this array in bytes.

Source

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

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.

Source

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

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.

Source

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

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.

Source

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

Returns the inner bytes array.

Source

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

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

Source

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

Compile-time equality. NOT constant-time equality.

Source

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

Computes the bitwise AND of two FixedBytes.

Source

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

Computes the bitwise OR of two FixedBytes.

Source

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

Computes the bitwise XOR of two FixedBytes.

Source§

impl Function

Source

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

Creates an Ethereum function from an EVM word’s lower 24 bytes (word[..24]).

Note that this is different from Address::from_word, which uses the upper 20 bytes.

Source

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

Right-pads the function to 32 bytes (EVM word size).

Note that this is different from Address::into_word, which left-pads the address.

Source

pub fn from_address_and_selector<A, S>(address: A, selector: S) -> Function
where A: Borrow<[u8; 20]>, S: Borrow<[u8; 4]>,

Creates an Ethereum function from an address and selector.

Source

pub fn as_address_and_selector(&self) -> (&Address, &FixedBytes<4>)

Returns references to the address and selector of the function.

Source

pub fn to_address_and_selector(&self) -> (Address, FixedBytes<4>)

Returns the address and selector of the function.

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

Source

pub const ZERO: FixedBytes<N>

Source

pub 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 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 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)

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

§Examples
#![feature(ascii_char)]

const HEX_DIGITS: [std::ascii::Char; 16] =
    *b"0123456789abcdef".as_ascii().unwrap();

assert_eq!(HEX_DIGITS[1].as_str(), "1");
assert_eq!(HEX_DIGITS[10].as_str(), "a");
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 an array of ASCII characters, without checking whether they’re valid.

§Safety

Every byte in the array must be in 0..=127, or else this is UB.

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

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 AsMut<[u8]> for Function

Source§

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

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

impl AsMut<[u8; 24]> for Function

Source§

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

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

impl AsMut<FixedBytes<24>> for Function

Source§

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

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

impl AsRef<[u8]> for Function

Source§

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

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

impl AsRef<[u8; 24]> for Function

Source§

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

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

impl AsRef<FixedBytes<24>> for Function

Source§

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

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

impl BitAnd<&Function> for Function

Source§

type Output = Function

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Function) -> Function

Performs the & operation. Read more
Source§

impl BitAnd for Function

Source§

type Output = Function

The resulting type after applying the & operator.
Source§

fn bitand(self, __rhs: Function) -> <Function as BitAnd>::Output

Performs the & operation. Read more
Source§

impl BitAndAssign<&Function> for Function

Source§

fn bitand_assign(&mut self, rhs: &Function)

Performs the &= operation. Read more
Source§

impl BitAndAssign for Function

Source§

fn bitand_assign(&mut self, __rhs: Function)

Performs the &= operation. Read more
Source§

impl BitOr<&Function> for Function

Source§

type Output = Function

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Function) -> Function

Performs the | operation. Read more
Source§

impl BitOr for Function

Source§

type Output = Function

The resulting type after applying the | operator.
Source§

fn bitor(self, __rhs: Function) -> <Function as BitOr>::Output

Performs the | operation. Read more
Source§

impl BitOrAssign<&Function> for Function

Source§

fn bitor_assign(&mut self, rhs: &Function)

Performs the |= operation. Read more
Source§

impl BitOrAssign for Function

Source§

fn bitor_assign(&mut self, __rhs: Function)

Performs the |= operation. Read more
Source§

impl BitXor<&Function> for Function

Source§

type Output = Function

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Function) -> Function

Performs the ^ operation. Read more
Source§

impl BitXor for Function

Source§

type Output = Function

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, __rhs: Function) -> <Function as BitXor>::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign<&Function> for Function

Source§

fn bitxor_assign(&mut self, rhs: &Function)

Performs the ^= operation. Read more
Source§

impl BitXorAssign for Function

Source§

fn bitxor_assign(&mut self, __rhs: Function)

Performs the ^= operation. Read more
Source§

impl Borrow<[u8]> for &Function

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl Borrow<[u8]> for &mut Function

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl Borrow<[u8]> for Function

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl Borrow<[u8; 24]> for &Function

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl Borrow<[u8; 24]> for &mut Function

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl Borrow<[u8; 24]> for Function

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<[u8]> for &mut Function

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl BorrowMut<[u8]> for Function

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl BorrowMut<[u8; 24]> for &mut Function

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl BorrowMut<[u8; 24]> for Function

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl Clone for Function

Source§

fn clone(&self) -> Function

Returns a duplicate 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 Debug for Function

Source§

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

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

impl Default for Function

Source§

fn default() -> Function

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

impl Deref for Function

Source§

type Target = FixedBytes<24>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for Function

Source§

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

Mutably dereferences the value.
Source§

impl Display for Function

Source§

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

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

impl<'a> From<&'a [u8; 24]> for &'a Function

Source§

fn from(value: &'a [u8; 24]) -> &'a Function

Converts to this type from the input type.
Source§

impl<'a> From<&'a [u8; 24]> for Function

Source§

fn from(value: &'a [u8; 24]) -> Function

Converts to this type from the input type.
Source§

impl<'a> From<&'a Function> for &'a [u8; 24]

Source§

fn from(value: &'a Function) -> &'a [u8; 24]

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut [u8; 24]> for &'a Function

Source§

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

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut [u8; 24]> for &'a mut Function

Source§

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

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut [u8; 24]> for Function

Source§

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

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut Function> for &'a [u8; 24]

Source§

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

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut Function> for &'a mut [u8; 24]

Source§

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

Converts to this type from the input type.
Source§

impl From<[u8; 24]> for Function

Source§

fn from(value: [u8; 24]) -> Function

Converts to this type from the input type.
Source§

impl<A, S> From<(A, S)> for Function
where A: Borrow<[u8; 20]>, S: Borrow<[u8; 4]>,

Source§

fn from(_: (A, S)) -> Function

Converts to this type from the input type.
Source§

impl From<FixedBytes<24>> for Function

Source§

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

Converts to this type from the input type.
Source§

impl From<Function> for [u8; 24]

Source§

fn from(value: Function) -> [u8; 24]

Converts to this type from the input type.
Source§

impl From<Function> for FixedBytes<24>

Source§

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

Converts to this type from the input type.
Source§

impl FromHex for Function

Source§

type Error = FromHexError

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

fn from_hex<T>(hex: T) -> Result<Function, <Function 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 FromStr for Function

Source§

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

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

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

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

impl Hash for Function

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> Index<__IdxT> for Function
where FixedBytes<24>: Index<__IdxT>,

Source§

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

The returned type after indexing.
Source§

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

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

impl<__IdxT> IndexMut<__IdxT> for Function
where FixedBytes<24>: IndexMut<__IdxT>,

Source§

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

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

impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime Function
where &'__deriveMoreLifetime FixedBytes<24>: IntoIterator,

Source§

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

The type of the elements being iterated over.
Source§

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

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

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

Creates an iterator from a value. Read more
Source§

impl<'__deriveMoreLifetime> IntoIterator for &'__deriveMoreLifetime mut Function
where &'__deriveMoreLifetime mut FixedBytes<24>: IntoIterator,

Source§

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

The type of the elements being iterated over.
Source§

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

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

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

Creates an iterator from a value. Read more
Source§

impl IntoIterator for Function

Source§

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

The type of the elements being iterated over.
Source§

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

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

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

Creates an iterator from a value. Read more
Source§

impl LowerHex for Function

Source§

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

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

impl Not for Function

Source§

type Output = Function

The resulting type after applying the ! operator.
Source§

fn not(self) -> Function

Performs the unary ! operation. Read more
Source§

impl Ord for Function

Source§

fn cmp(&self, other: &Function) -> 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
Source§

impl PartialEq<&[u8]> for Function

Source§

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

impl PartialEq<&[u8; 24]> for Function

Source§

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

impl PartialEq<&Function> for [u8]

Source§

fn eq(&self, other: &&Function) -> 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.
Source§

impl PartialEq<&Function> for [u8; 24]

Source§

fn eq(&self, other: &&Function) -> 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.
Source§

impl PartialEq<[u8]> for &Function

Source§

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

impl PartialEq<[u8]> for Function

Source§

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

impl PartialEq<[u8; 24]> for &Function

Source§

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

impl PartialEq<[u8; 24]> for Function

Source§

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

impl PartialEq<Function> for &[u8]

Source§

fn eq(&self, other: &Function) -> 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.
Source§

impl PartialEq<Function> for &[u8; 24]

Source§

fn eq(&self, other: &Function) -> 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.
Source§

impl PartialEq<Function> for [u8]

Source§

fn eq(&self, other: &Function) -> 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.
Source§

impl PartialEq<Function> for [u8; 24]

Source§

fn eq(&self, other: &Function) -> 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.
Source§

impl PartialEq for Function

Source§

fn eq(&self, other: &Function) -> 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.
Source§

impl PartialOrd<&[u8]> for Function

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

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

impl PartialOrd<&Function> for [u8]

Source§

fn partial_cmp(&self, other: &&Function) -> 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
Source§

impl PartialOrd<[u8]> for &Function

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

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

impl PartialOrd<[u8]> for Function

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

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

impl PartialOrd<Function> for &[u8]

Source§

fn partial_cmp(&self, other: &Function) -> 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
Source§

impl PartialOrd<Function> for [u8]

Source§

fn partial_cmp(&self, other: &Function) -> 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
Source§

impl PartialOrd for Function

Source§

fn partial_cmp(&self, other: &Function) -> 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
Source§

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

Source§

type Error = TryFromSliceError

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

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

Performs the conversion.
Source§

impl TryFrom<&[u8]> for Function

Source§

type Error = TryFromSliceError

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

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

Performs the conversion.
Source§

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

Source§

type Error = TryFromSliceError

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

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

Performs the conversion.
Source§

impl TryFrom<&mut [u8]> for Function

Source§

type Error = TryFromSliceError

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

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

Performs the conversion.
Source§

impl UpperHex for Function

Source§

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

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

impl Copy for Function

Source§

impl Eq for Function

Source§

impl StructuralPartialEq for Function

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

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

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> 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<I> BidiIterator for I

Source§

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

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

Source§

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

Compare self to key and return their ordering.
Source§

impl<T> Conv for T

Source§

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

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

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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.
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
Source§

impl<T> FmtForward for T

Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

Source§

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

Source§

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

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

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

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

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

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

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

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

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

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

Immutable access to a value. Read more
Source§

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

Mutable access to a value. Read more
Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Source§

fn encode_hex(&self) -> String

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

fn encode_hex_upper(&self) -> String

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

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

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,

Source§

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§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

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

Source§

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

Source§

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

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