Struct Protocol

Source
#[non_exhaustive]
pub struct Protocol { pub name: &'static str, pub hash: Hash, /* private fields */ }
Expand description

A built in instance function.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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.

§hash: Hash

The hash of the builtin function.

Implementations§

Source§

impl Protocol

Source

pub const GET: Protocol

The function to access a field.

Source

pub const GET_HASH: Hash

Source

pub const SET: Protocol

The function to set a field.

Source

pub const SET_HASH: Hash

Source

pub const INDEX_GET: Protocol

The function to access an index.

Source

pub const INDEX_GET_HASH: Hash

Source

pub const INDEX_SET: Protocol

The function to set an index.

Source

pub const INDEX_SET_HASH: Hash

Source

pub const PARTIAL_EQ: Protocol

Check two types for partial equality.

Source

pub const PARTIAL_EQ_HASH: Hash

Source

pub const EQ: Protocol

Check two types for total equality.

Source

pub const EQ_HASH: Hash

Source

pub const PARTIAL_CMP: Protocol

Perform an partial comparison between two values.

Source

pub const PARTIAL_CMP_HASH: Hash

Source

pub const CMP: Protocol

Perform an total comparison between two values.

Source

pub const CMP_HASH: Hash

Source

pub const ADD: Protocol

The function to implement for the addition operation.

Source

pub const ADD_HASH: Hash

Source

pub const ADD_ASSIGN: Protocol

The function to implement for the addition assign operation.

Source

pub const ADD_ASSIGN_HASH: Hash

Source

pub const SUB: Protocol

The function to implement for the subtraction operation.

Source

pub const SUB_HASH: Hash

Source

pub const SUB_ASSIGN: Protocol

The function to implement for the subtraction assign operation.

Source

pub const SUB_ASSIGN_HASH: Hash

Source

pub const MUL: Protocol

The function to implement for the multiply operation.

Source

pub const MUL_HASH: Hash

Source

pub const MUL_ASSIGN: Protocol

The function to implement for the multiply assign operation.

Source

pub const MUL_ASSIGN_HASH: Hash

Source

pub const DIV: Protocol

The function to implement for the division operation.

Source

pub const DIV_HASH: Hash

Source

pub const DIV_ASSIGN: Protocol

The function to implement for the division assign operation.

Source

pub const DIV_ASSIGN_HASH: Hash

Source

pub const REM: Protocol

The function to implement for the remainder operation.

Source

pub const REM_HASH: Hash

Source

pub const REM_ASSIGN: Protocol

The function to implement for the remainder assign operation.

Source

pub const REM_ASSIGN_HASH: Hash

Source

pub const BIT_AND: Protocol

The function to implement for the bitwise and operation.

Source

pub const BIT_AND_HASH: Hash

Source

pub const BIT_AND_ASSIGN: Protocol

The function to implement for the bitwise and assign operation.

Source

pub const BIT_AND_ASSIGN_HASH: Hash

Source

pub const BIT_XOR: Protocol

The function to implement for the bitwise xor operation.

Source

pub const BIT_XOR_HASH: Hash

Source

pub const BIT_XOR_ASSIGN: Protocol

The function to implement for the bitwise xor assign operation.

Source

pub const BIT_XOR_ASSIGN_HASH: Hash

Source

pub const BIT_OR: Protocol

The function to implement for the bitwise or operation.

Source

pub const BIT_OR_HASH: Hash

Source

pub const BIT_OR_ASSIGN: Protocol

The function to implement for the bitwise xor assign operation.

Source

pub const BIT_OR_ASSIGN_HASH: Hash

Source

pub const SHL: Protocol

The function to implement for the bitwise shift left operation.

Source

pub const SHL_HASH: Hash

Source

pub const SHL_ASSIGN: Protocol

The function to implement for the bitwise shift left assign operation.

Source

pub const SHL_ASSIGN_HASH: Hash

Source

pub const SHR: Protocol

The function to implement for the bitwise shift right operation.

Source

pub const SHR_HASH: Hash

Source

pub const SHR_ASSIGN: Protocol

The function to implement for the bitwise shift right assign operation.

Source

pub const SHR_ASSIGN_HASH: Hash

Source

pub const STRING_DISPLAY: Protocol

Protocol function used by template strings.

Source

pub const STRING_DISPLAY_HASH: Hash

Source

pub const STRING_DEBUG: Protocol

Protocol function used by custom debug impls.

Source

pub const STRING_DEBUG_HASH: Hash

Source

pub const INTO_ITER: Protocol

Function used to convert an argument into an iterator.

Source

pub const INTO_ITER_HASH: Hash

Source

pub const NEXT: Protocol

The function to call to continue iteration.

Source

pub const NEXT_HASH: Hash

Source

pub const INTO_FUTURE: Protocol

Function used to convert an argument into a future.

Signature: fn(Value) -> Future.

Source

pub const INTO_FUTURE_HASH: Hash

Source

pub const INTO_TYPE_NAME: Protocol

Coerce a value into a type name. This is stored as a constant.

Source

pub const INTO_TYPE_NAME_HASH: Hash

Source

pub const IS_VARIANT: Protocol

Function used to test if a value is a specific variant.

Signature: fn(self, usize) -> bool.

Source

pub const IS_VARIANT_HASH: Hash

Source

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

Source

pub const TRY_HASH: Hash

Source

pub const HASH: Protocol

Protocol used when calculating a hash.

Source

pub const HASH_HASH: Hash

Source

pub fn from_hash(hash: Hash) -> Option<Protocol>

Look up protocol for the given hash.

Methods from Deref<Target = Hash>§

Source

pub const EMPTY: Hash

Trait Implementations§

Source§

impl Clone for Protocol

Source§

fn clone(&self) -> Protocol

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 Protocol

Source§

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

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

impl Deref for Protocol

Source§

type Target = Hash

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl Display for Protocol

Source§

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

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

impl Hash for Protocol

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 IntoHash for Protocol

Source§

fn into_hash(self) -> Hash

Convert current type into a hash.
Source§

impl PartialEq for Protocol

Source§

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

Source§

fn try_clone(&self) -> Result<Protocol, Error>

Try to clone the current value, raising an allocation error if it’s unsuccessful.
Source§

fn try_clone_from(&mut self, source: &Self) -> Result<(), Error>

Performs copy-assignment from source. Read more
Source§

impl Copy for Protocol

Source§

impl Eq for Protocol

Source§

impl ToTypeHash for Protocol

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

Source§

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

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<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> 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, 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> TryToOwned for T
where T: TryClone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn try_to_owned(&self) -> Result<T, Error>

Creates owned data from borrowed data, usually by cloning. Read more
Source§

impl<T> TryToString for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T