#[non_exhaustive]pub struct Protocol {
pub name: &'static str,
pub method: Option<&'static str>,
pub hash: Hash,
/* private fields */
}
Expand description
A built in instance function.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.name: &'static str
The name of the builtin function.
method: Option<&'static str>
If this protocol defines an associated method, this is the name of that method.
hash: Hash
The hash of the builtin function.
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub const PARTIAL_EQ: Protocol = _
pub const PARTIAL_EQ: Protocol = _
Check two types for partial equality.
Sourcepub const PARTIAL_CMP: Protocol = _
pub const PARTIAL_CMP: Protocol = _
Perform an partial comparison between two values.
pub const MAX: Protocol = _
pub const MIN: Protocol = _
Sourcepub const ADD_ASSIGN: Protocol = _
pub const ADD_ASSIGN: Protocol = _
The function to implement for the addition assign operation.
Sourcepub const SUB_ASSIGN: Protocol = _
pub const SUB_ASSIGN: Protocol = _
The function to implement for the subtraction assign operation.
Sourcepub const MUL_ASSIGN: Protocol = _
pub const MUL_ASSIGN: Protocol = _
The function to implement for the multiply assign operation.
Sourcepub const DIV_ASSIGN: Protocol = _
pub const DIV_ASSIGN: Protocol = _
The function to implement for the division assign operation.
Sourcepub const REM_ASSIGN: Protocol = _
pub const REM_ASSIGN: Protocol = _
The function to implement for the remainder assign operation.
Sourcepub const BIT_AND_ASSIGN: Protocol = _
pub const BIT_AND_ASSIGN: Protocol = _
The function to implement for the bitwise and assign operation.
Sourcepub const BIT_XOR_ASSIGN: Protocol = _
pub const BIT_XOR_ASSIGN: Protocol = _
The function to implement for the bitwise xor assign operation.
Sourcepub const BIT_OR_ASSIGN: Protocol = _
pub const BIT_OR_ASSIGN: Protocol = _
The function to implement for the bitwise xor assign operation.
Sourcepub const SHL_ASSIGN: Protocol = _
pub const SHL_ASSIGN: Protocol = _
The function to implement for the bitwise shift left assign operation.
Sourcepub const SHR_ASSIGN: Protocol = _
pub const SHR_ASSIGN: Protocol = _
The function to implement for the bitwise shift right assign operation.
Sourcepub const DISPLAY_FMT: Protocol = _
pub const DISPLAY_FMT: Protocol = _
Protocol function used by template strings.
Sourcepub const NTH_BACK: Protocol = _
pub const NTH_BACK: Protocol = _
The function to call to continue iteration at the nth element form the back.
Sourcepub const INTO_FUTURE: Protocol = _
pub const INTO_FUTURE: Protocol = _
Function used to convert an argument into a future.
Signature: fn(Value) -> Future
.
Sourcepub const INTO_TYPE_NAME: Protocol = _
pub const INTO_TYPE_NAME: Protocol = _
Coerce a value into a type name. This is stored as a constant.
Sourcepub const IS_VARIANT: Protocol = _
pub const IS_VARIANT: Protocol = _
Function used to test if a value is a specific variant.
Signature: fn(self, usize) -> bool
.
Sourcepub const TRY: Protocol = _
pub const TRY: Protocol = _
Function used for the question mark operation.
Signature: fn(self) -> Result
.
Note that it uses the Result
like Try
uses ControlFlow
i.e.,
for Result::<T, E>
it should return Result<T, Result<(), E>>