Struct alloy_primitives::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: Self = _

Array of Zero bytes.

source

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

Wraps the given byte array in this type.

source

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

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

source

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

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]) -> Self

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]) -> Self

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]) -> Self

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: &Self) -> bool

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

source

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

Compile-time equality. NOT constant-time equality.

source

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

Computes the bitwise AND of two FixedBytes.

source

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

Computes the bitwise OR of two FixedBytes.

source

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

Computes the bitwise XOR of two FixedBytes.

source§

impl Function

source

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

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) -> Self
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, &Selector)

Returns references to the address and selector of the function.

source

pub fn to_address_and_selector(&self) -> (Address, Selector)

Returns the address and selector of the function.

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

source

pub const ZERO: Self = _

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: &Self) -> bool

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

source

pub fn const_eq(&self, other: &Self) -> 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]>§

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

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 for Function

§

type Output = Function

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Function) -> 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 for Function

§

type Output = Function

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Function) -> 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 for Function

§

type Output = Function

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Function) -> 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 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 Debug for Function

source§

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

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

impl Decodable for Function

source§

fn decode(buf: &mut &[u8]) -> Result<Self>

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

impl Default for Function

source§

fn default() -> Function

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

impl Deref for Function

§

type Target = FixedBytes<24>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Function

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for Function

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

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

impl Display for Function

source§

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

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

impl Encodable for Function

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> 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]) -> Self

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]) -> Self

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]) -> Self

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((address, selector): (A, S)) -> Self

Converts to this type from the input type.
source§

impl From<FixedBytes<24>> for Function

source§

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

Converts to this type from the input type.
source§

impl From<Function> for [u8; 24]

source§

fn from(value: Function) -> Self

Converts to this type from the input type.
source§

impl From<Function> for FixedBytes<24>

source§

fn from(value: Function) -> Self

Converts to this type from the input type.
source§

impl FromHex for Function

§

type Error = FromHexError

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

fn from_hex<T: AsRef<[u8]>>(hex: T) -> Result<Self, Self::Error>

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

§

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

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

fn from_str(src: &str) -> Result<Self, Self::Err>

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

impl Hash for Function

source§

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

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

§

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

The returned type after indexing.
source§

fn index(&self, idx: __IdxT) -> &Self::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 Self::Output

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

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

§

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

The type of the elements being iterated over.
§

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

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

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

§

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

The type of the elements being iterated over.
§

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

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for Function

§

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

The type of the elements being iterated over.
§

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

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for Function

source§

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

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

impl MaxEncodedLenAssoc for Function

source§

const LEN: usize = 25usize

The maximum length.
source§

impl Not for Function

§

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

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

impl PartialEq<&[u8]> for Function

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 PartialEq<&[u8; 24]> for Function

source§

fn eq(&self, other: &&[u8; 24]) -> 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 PartialEq<&Function> for [u8]

source§

fn eq(&self, other: &&Function) -> 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 PartialEq<&Function> for [u8; 24]

source§

fn eq(&self, other: &&Function) -> 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 PartialEq<[u8]> for &Function

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

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 PartialEq<[u8; 24]> for &Function

source§

fn eq(&self, other: &[u8; 24]) -> 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 PartialEq<[u8; 24]> for Function

source§

fn eq(&self, other: &[u8; 24]) -> 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 PartialEq<Function> for &[u8]

source§

fn eq(&self, other: &Function) -> 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 PartialEq<Function> for &[u8; 24]

source§

fn eq(&self, other: &Function) -> 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 PartialEq<Function> for [u8]

source§

fn eq(&self, other: &Function) -> 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 PartialEq<Function> for [u8; 24]

source§

fn eq(&self, other: &Function) -> 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 PartialEq for Function

source§

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

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

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

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

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

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

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

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 Serialize for Function

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

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

§

type Error = TryFromSliceError

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

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

Performs the conversion.
source§

impl TryFrom<&[u8]> for Function

§

type Error = TryFromSliceError

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

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

Performs the conversion.
source§

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

§

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, Self::Error>

Performs the conversion.
source§

impl TryFrom<&mut [u8]> for Function

§

type Error = TryFromSliceError

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

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

Performs the conversion.
source§

impl UpperHex for Function

source§

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

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

impl Copy for Function

source§

impl Eq for Function

source§

impl MaxEncodedLen<{ $len }> for Function

source§

impl StructuralPartialEq for Function

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
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: Copy,

source§

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

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

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

source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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<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<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> Same for T

§

type Output = T

Should always be Self
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> 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,

§

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

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