Struct rune::runtime::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

§

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

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 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<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<T> Same for T

§

type Output = T

Should always be Self
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> TryToOwned for T
where T: TryClone,

§

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