rune::runtime

Enum Inst

Source
pub enum Inst {
Show 69 variants Allocate { size: usize, }, Not { addr: InstAddress, out: Output, }, Neg { addr: InstAddress, out: Output, }, Closure { hash: Hash, addr: InstAddress, count: usize, out: Output, }, CallOffset { offset: usize, call: Call, addr: InstAddress, args: usize, out: Output, }, Call { hash: Hash, addr: InstAddress, args: usize, out: Output, }, CallAssociated { hash: Hash, addr: InstAddress, args: usize, out: Output, }, LoadInstanceFn { addr: InstAddress, hash: Hash, out: Output, }, CallFn { function: InstAddress, addr: InstAddress, args: usize, out: Output, }, IndexGet { target: InstAddress, index: InstAddress, out: Output, }, TupleIndexSet { target: InstAddress, index: usize, value: InstAddress, }, TupleIndexGetAt { addr: InstAddress, index: usize, out: Output, }, ObjectIndexSet { target: InstAddress, slot: usize, value: InstAddress, }, ObjectIndexGetAt { addr: InstAddress, slot: usize, out: Output, }, IndexSet { target: InstAddress, index: InstAddress, value: InstAddress, }, Await { addr: InstAddress, out: Output, }, Select { addr: InstAddress, len: usize, value: Output, }, LoadFn { hash: Hash, out: Output, }, Store { value: InstValue, out: Output, }, Copy { addr: InstAddress, out: Output, }, Move { addr: InstAddress, out: Output, }, Drop { set: usize, }, Swap { a: InstAddress, b: InstAddress, }, Return { addr: InstAddress, }, ReturnUnit, Jump { jump: usize, }, JumpIf { cond: InstAddress, jump: usize, }, JumpIfNot { cond: InstAddress, jump: usize, }, Vec { addr: InstAddress, count: usize, out: Output, }, Tuple1 { addr: [InstAddress; 1], out: Output, }, Tuple2 { addr: [InstAddress; 2], out: Output, }, Tuple3 { addr: [InstAddress; 3], out: Output, }, Tuple4 { addr: [InstAddress; 4], out: Output, }, Tuple { addr: InstAddress, count: usize, out: Output, }, Environment { addr: InstAddress, count: usize, out: Output, }, Object { addr: InstAddress, slot: usize, out: Output, }, Range { range: InstRange, out: Output, }, EmptyStruct { hash: Hash, out: Output, }, Struct { addr: InstAddress, hash: Hash, out: Output, }, ConstConstruct { addr: InstAddress, hash: Hash, count: usize, out: Output, }, String { slot: usize, out: Output, }, Bytes { slot: usize, out: Output, }, StringConcat { addr: InstAddress, len: usize, size_hint: usize, out: Output, }, Format { addr: InstAddress, spec: FormatSpec, out: Output, }, IsUnit { addr: InstAddress, out: Output, }, Try { addr: InstAddress, out: Output, }, EqChar { addr: InstAddress, value: char, out: Output, }, EqSigned { addr: InstAddress, value: i64, out: Output, }, EqUnsigned { addr: InstAddress, value: u64, out: Output, }, EqBool { addr: InstAddress, value: bool, out: Output, }, EqString { addr: InstAddress, slot: usize, out: Output, }, EqBytes { addr: InstAddress, slot: usize, out: Output, }, MatchType { hash: Hash, addr: InstAddress, out: Output, }, MatchVariant { variant_hash: Hash, enum_hash: Hash, index: usize, addr: InstAddress, out: Output, }, MatchBuiltIn { type_check: TypeCheck, addr: InstAddress, out: Output, }, MatchSequence { type_check: TypeCheck, len: usize, exact: bool, addr: InstAddress, out: Output, }, MatchObject { slot: usize, exact: bool, addr: InstAddress, out: Output, }, Yield { addr: InstAddress, out: Output, }, YieldUnit { out: Output, }, Variant { addr: InstAddress, variant: InstVariant, out: Output, }, Op { op: InstOp, a: InstAddress, b: InstAddress, out: Output, }, Arithmetic { op: InstArithmeticOp, a: InstAddress, b: InstAddress, out: Output, }, Bitwise { op: InstBitwiseOp, a: InstAddress, b: InstAddress, out: Output, }, Shift { op: InstShiftOp, a: InstAddress, b: InstAddress, out: Output, }, AssignArithmetic { op: InstArithmeticOp, target: InstTarget, rhs: InstAddress, }, AssignBitwise { op: InstBitwiseOp, target: InstTarget, rhs: InstAddress, }, AssignShift { op: InstShiftOp, target: InstTarget, rhs: InstAddress, }, IterNext { addr: InstAddress, jump: usize, out: Output, }, Panic { reason: PanicReason, },
}
Expand description

An operation in the stack-based virtual machine.

Variants§

§

Allocate

Make sure that the memory region has size slots of memory available.

Fields

§size: usize

The size of the memory region to allocate.

§

Not

Not operator. Takes a boolean from the top of the stack and inverts its logical value.

§Operation

<bool>
=> <bool>

Fields

§addr: InstAddress

The operand to negate.

§out: Output

Whether the produced value from the not should be kept or not.

§

Neg

Negate the numerical value on the stack.

§Operation

<number>
=> <number>

Fields

§addr: InstAddress

The operand to negate.

§out: Output

Whether the produced value from the negation should be kept or not.

§

Closure

Construct a closure that takes the given number of arguments and captures count elements from the top of the stack.

§Operation

<value..>
=> <fn>

Fields

§hash: Hash

The hash of the internally stored closure function.

§addr: InstAddress

Where to load captured values from.

§count: usize

The number of captured values to store in the environment.

§out: Output

Where to store the produced closure.

§

CallOffset

Perform a function call within the same unit.

It will construct a new stack frame which includes the last args number of entries.

Fields

§offset: usize

The offset of the function being called in the same unit.

§call: Call

The calling convention to use.

§addr: InstAddress

The address where the arguments are stored.

§args: usize

The number of arguments passed in at addr.

§out: Output

Whether the return value should be kept or not.

§

Call

Call a function by hash.

The function will be looked up in the unit and context. The arguments passed to the function call are stored at addr, where size determines the number of arguments. The arguments will be dropped.

The return value of the function call will be written to out.

Fields

§hash: Hash

The hash of the function to call.

§addr: InstAddress

The address of the arguments being passed.

§args: usize

The number of arguments passed in at addr.

§out: Output

Whether the return value should be kept or not.

§

CallAssociated

Call an associated function.

The instance being called should be the the object at address addr. The number of arguments specified should include this object.

The return value of the function call will be written to out.

Fields

§hash: Hash

The hash of the name of the function to call.

§addr: InstAddress

The address of arguments being passed.

§args: usize

The number of arguments passed in at addr.

§out: Output

Whether the return value should be kept or not.

§

LoadInstanceFn

Look up an instance function.

The instance being used is stored at addr, and the function hash to look up is hash.

Fields

§addr: InstAddress

The address of the instance for which the function is being loaded.

§hash: Hash

The name hash of the instance function.

§out: Output

Where to store the loaded instance function.

§

CallFn

Perform a function call on a function pointer stored on the stack.

§Operation

<fn>
<args...>
=> <ret>

Fields

§function: InstAddress

The address of the function being called.

§addr: InstAddress

The address of the arguments being passed.

§args: usize

The number of arguments passed in at addr.

§out: Output

Whether the returned value from calling the function should be kept or not.

§

IndexGet

Perform an index get operation. Pushing the result on the stack.

§Operation

<target>
<index>
=> <value>

Fields

§target: InstAddress

How the target is addressed.

§index: InstAddress

How the index is addressed.

§out: Output

Whether the produced value should be kept or not.

§

TupleIndexSet

Set the given index of the tuple on the stack, with the given value.

§Operation

<value>
<tuple>
=> *nothing*

Fields

§target: InstAddress

The object being assigned to.

§index: usize

The index to set.

§value: InstAddress

The value being assigned.

§

TupleIndexGetAt

Get the given index out of a tuple from the given variable slot. Errors if the item doesn’t exist or the item is not a tuple.

§Operation

=> <value>

Fields

§addr: InstAddress

The address where the tuple we are getting from is stored.

§index: usize

The index to fetch.

§out: Output

Whether the produced value should be kept or not.

§

ObjectIndexSet

Set the given index out of an object on the top of the stack. Errors if the item doesn’t exist or the item is not an object.

The index is identifier by a static string slot, which is provided as an argument.

§Operation

<object>
<value>
=>

Fields

§target: InstAddress

The object being assigned to.

§slot: usize

The static string slot corresponding to the index to set.

§value: InstAddress

The value being assigned.

§

ObjectIndexGetAt

Get the given index out of an object from the given variable slot. Errors if the item doesn’t exist or the item is not an object.

The index is identifier by a static string slot, which is provided as an argument.

§Operation

=> <value>

Fields

§addr: InstAddress

The address where the object is stored.

§slot: usize

The static string slot corresponding to the index to fetch.

§out: Output

Where to store the fetched value.

§

IndexSet

Perform an index set operation.

§Operation

<target>
<index>
<value>
=> *noop*

Fields

§target: InstAddress

The object being assigned to.

§index: InstAddress

The index to set.

§value: InstAddress

The value being assigned.

§

Await

Await the future that is on the stack and push the value that it produces.

§Operation

<future>
=> <value>

Fields

§addr: InstAddress

Address of the future being awaited.

§out: Output

Whether the produced value from the await should be kept or not.

§

Select

Select over len futures stored at address addr.

Once a branch has been matched, will store the branch that matched in the branch register and perform a jump by the index of the branch that matched.

Will also store the output if the future into value. If no branch matched, the empty value will be stored.

Fields

§addr: InstAddress

The base address of futures being waited on.

§len: usize

The number of futures to poll.

§value: Output

Where to store the value produced by the future that completed.

§

LoadFn

Load the given function by hash and push onto the stack.

§Operation

=> <value>

Fields

§hash: Hash

The hash of the function to push.

§out: Output

Where to store the loaded function.

§

Store

Push a value onto the stack.

§Operation

=> <value>

Fields

§value: InstValue

The value to push.

§out: Output

Where the value is being copied to.

§

Copy

Copy a variable from a location offset relative to the current call frame.

A copy is very cheap. It simply means pushing a reference to the stack.

Fields

§addr: InstAddress

Address of the value being copied.

§out: Output

Where the value is being copied to.

§

Move

Move a variable from a location offset relative to the current call frame.

Fields

§addr: InstAddress

Address of the value being moved.

§out: Output

Where the value is being moved to.

§

Drop

Drop the given value set.

Fields

§set: usize

An indicator of the set of addresses to drop.

§

Swap

Swap two values on the stack using their offsets relative to the current stack frame.

Fields

§a: InstAddress

Offset to the first value.

§b: InstAddress

Offset to the second value.

§

Return

Pop the current stack frame and restore the instruction pointer from it.

The stack frame will be cleared, and the value on the top of the stack will be left on top of it.

Fields

§addr: InstAddress

The address of the value to return.

§

ReturnUnit

Pop the current stack frame and restore the instruction pointer from it.

The stack frame will be cleared, and a unit value will be pushed to the top of the stack.

§

Jump

Unconditionally jump to offset relative to the current instruction pointer.

§Operation

*nothing*
=> *nothing*

Fields

§jump: usize

Offset to jump to.

§

JumpIf

Jump to offset relative to the current instruction pointer if the condition is true.

§Operation

<boolean>
=> *nothing*

Fields

§cond: InstAddress

The address of the condition for the jump.

§jump: usize

Offset to jump to.

§

JumpIfNot

Jump to the given offset If the top of the stack is false.

§Operation

<bool>
=> *noop*

Fields

§cond: InstAddress

The address of the condition for the jump.

§jump: usize

The offset to jump if the condition is true.

§

Vec

Construct a vector at out, populating it with count elements from addr.

The values at addr are dropped.

Fields

§addr: InstAddress

Where the arguments to the vector are stored.

§count: usize

The number of elements in the vector.

§out: Output

Where to store the produced vector.

§

Tuple1

Construct a one element tuple at out, populating it with count elements from addr.

The values at addr are not dropped.

Fields

§addr: [InstAddress; 1]

Tuple arguments.

§out: Output

Where to store the produced tuple.

§

Tuple2

Construct a two element tuple at out, populating it with count elements from addr.

The values at addr are not dropped.

Fields

§addr: [InstAddress; 2]

Tuple arguments.

§out: Output

Where to store the produced tuple.

§

Tuple3

Construct a three element tuple at out, populating it with count elements from addr.

The values at addr are not dropped.

Fields

§addr: [InstAddress; 3]

Tuple arguments.

§out: Output

Where to store the produced tuple.

§

Tuple4

Construct a four element tuple at out, populating it with count elements from addr.

The values at addr are not dropped.

Fields

§addr: [InstAddress; 4]

Tuple arguments.

§out: Output

Where to store the produced tuple.

§

Tuple

Construct a tuple at out, populating it with count elements from addr.

Unlike TupleN variants, values at addr are dropped.

Fields

§addr: InstAddress

Where the arguments to the tuple are stored.

§count: usize

The number of elements in the tuple.

§out: Output

Where to store the produced tuple.

§

Environment

Take the tuple that is on top of the stack and push its content onto the stack.

This is used to unpack an environment for closures - if the closure has an environment.

§Operation

<tuple>
=> <value...>

Fields

§addr: InstAddress

The tuple to push.

§count: usize

The expected size of the tuple.

§out: Output

Where to unpack the environment.

§

Object

Construct a push an object onto the stack. The number of elements in the object are determined the slot of the object keys slot and are popped from the stack.

For each element, a value is popped corresponding to the object key.

§Operation

<value..>
=> <object>

Fields

§addr: InstAddress

Where the arguments to the tuple are stored.

§slot: usize

The static slot of the object keys.

§out: Output

Where to store the produced tuple.

§

Range

Construct a range.

The arguments loaded are determined by the range being constructed.

Fields

§range: InstRange

The kind of the range, which determines the number arguments on the stack.

§out: Output

Where to store the produced range.

§

EmptyStruct

Construct a push an object of the given type onto the stack. The type is an empty struct.

§Operation

=> <object>

Fields

§hash: Hash

The type of the object to construct.

§out: Output

Where to write the empty struct.

§

Struct

Construct a struct of type hash at out, populating it with fields from addr. The number of fields and their names is determined by the slot being referenced.

The values at addr are dropped.

Fields

§addr: InstAddress

The address to load fields from.

§hash: Hash

The type of the struct to construct.

§out: Output

Where to write the constructed struct.

§

ConstConstruct

Construct a struct from a constant.

The values at addr are dropped.

Fields

§addr: InstAddress

Where constructor arguments are stored.

§hash: Hash

The type of the struct to construct.

§count: usize

The number of constructor arguments.

§out: Output

Where to write the constructed struct.

§

String

Load a literal string from a static string slot.

§Operation

=> <string>

Fields

§slot: usize

The static string slot to load the string from.

§out: Output

Where to store the string.

§

Bytes

Load a literal byte string from a static byte string slot.

§Operation

=> <bytes>

Fields

§slot: usize

The static byte string slot to load the string from.

§out: Output

Where to store the bytes.

§

StringConcat

Pop the given number of values from the stack, and concatenate a string from them.

This is a dedicated template-string optimization.

§Operation

<value...>
=> <string>

Fields

§addr: InstAddress

Where the strings to concatenate are stored.

§len: usize

The number of items to pop from the stack.

§size_hint: usize

The minimum string size used.

§out: Output

Where to store the produced string.

§

Format

Push a combined format specification and value onto the stack. The value used is the last value on the stack.

Fields

§addr: InstAddress

Address of the value being formatted.

§spec: FormatSpec

The format specification to use.

§out: Output

Where to store the produced format.

§

IsUnit

Test if the top of the stack is a unit.

§Operation

<value>
=> <boolean>

Fields

§addr: InstAddress

The address of the value to test.

§out: Output

Where to store the output.

§

Try

Perform the try operation which takes the value at the given address and tries to unwrap it or return from the current call frame.

§Operation

<value>
=> <boolean>

Fields

§addr: InstAddress

Address of value to try.

§out: Output

Where to store the value in case there is a continuation.

§

EqChar

Test if the top of the stack is a specific character.

§Operation

<value>
=> <boolean>

Fields

§addr: InstAddress

Address of the value to compare.

§value: char

The character to test against.

§out: Output

Where to store the result of the comparison.

§

EqSigned

Test if the specified value is a specific signed integer.

Fields

§addr: InstAddress

Address of the value to compare.

§value: i64

The value to test against.

§out: Output

Where to store the result of the comparison.

§

EqUnsigned

Test if the specified value is a specific unsigned integer.

Fields

§addr: InstAddress

Address of the value to compare.

§value: u64

The value to test against.

§out: Output

Where to store the result of the comparison.

§

EqBool

Test if the top of the stack is a specific boolean.

§Operation

<value>
=> <boolean>

Fields

§addr: InstAddress

Address of the value to compare.

§value: bool

The value to test against.

§out: Output

Where to store the result of the comparison.

§

EqString

Compare the top of the stack against a static string slot.

§Operation

<value>
=> <boolean>

Fields

§addr: InstAddress

Address of the value to compare.

§slot: usize

The slot to test against.

§out: Output

Where to store the result of the comparison.

§

EqBytes

Compare the top of the stack against a static bytes slot.

§Operation

<value>
=> <boolean>

Fields

§addr: InstAddress

Address of the value to compare.

§slot: usize

The slot to test against.

§out: Output

Where to store the result of the comparison.

§

MatchType

Test that the top of the stack has the given type.

§Operation

<value>
=> <boolean>

Fields

§hash: Hash

The type hash to match against.

§addr: InstAddress

The address of the value to test.

§out: Output

Where to store the output.

§

MatchVariant

Test if the specified variant matches. This is distinct from Inst::MatchType because it will match immediately on the variant type if appropriate which is possible for internal types, but external types will require an additional runtime check for matching.

§Operation

<value>
=> <boolean>

Fields

§variant_hash: Hash

The exact type hash of the variant.

§enum_hash: Hash

The container type.

§index: usize

The index of the variant.

§addr: InstAddress

The address of the value to test.

§out: Output

Where to store the output.

§

MatchBuiltIn

Test if the top of the stack is the given builtin type or variant.

§Operation

<value>
=> <boolean>

Fields

§type_check: TypeCheck

The type to check for.

§addr: InstAddress

The address of the value to test.

§out: Output

Where to store the output.

§

MatchSequence

Test that the top of the stack is a tuple with the given length requirements.

§Operation

<value>
=> <boolean>

Fields

§type_check: TypeCheck

Type constraints that the sequence must match.

§len: usize

The minimum length to test for.

§exact: bool

Whether the operation should check exact true or minimum length false.

§addr: InstAddress

The address of the value to test.

§out: Output

Where to store the output.

§

MatchObject

Test that the top of the stack is an object matching the given slot of object keys.

§Operation

<object>
=> <boolean>

Fields

§slot: usize

The slot of object keys to use.

§exact: bool

Whether the operation should check exact true or minimum length false.

§addr: InstAddress

The address of the value to test.

§out: Output

Where to store the output.

§

Yield

Perform a generator yield where the value yielded is expected to be found at the top of the stack.

This causes the virtual machine to suspend itself.

§Operation

<value>
=> <value>

Fields

§addr: InstAddress

Address of the value being yielded.

§out: Output

Where to store the produced resume value.

§

YieldUnit

Perform a generator yield with a unit.

This causes the virtual machine to suspend itself.

§Operation

=> <unit>

Fields

§out: Output

Where to store the produced resume value.

§

Variant

Construct a built-in variant onto the stack.

The variant will pop as many values of the stack as necessary to construct it.

§Operation

<value..>
=> <variant>

Fields

§addr: InstAddress

Where the arguments to construct the variant are stored.

§variant: InstVariant

The kind of built-in variant to construct.

§out: Output

Where to store the variant.

§

Op

An operation.

Fields

§op: InstOp

The kind of operation.

§a: InstAddress

The address of the first argument.

§b: InstAddress

The address of the second argument.

§out: Output

Whether the produced value from the operation should be kept or not.

§

Arithmetic

An arithmetic operation.

Fields

§op: InstArithmeticOp

The kind of operation.

§a: InstAddress

The address of the first argument.

§b: InstAddress

The address of the second argument.

§out: Output

Whether the produced value from the operation should be kept or not.

§

Bitwise

A bitwise operation.

Fields

§op: InstBitwiseOp

The kind of operation.

§a: InstAddress

The address of the first argument.

§b: InstAddress

The address of the second argument.

§out: Output

Whether the produced value from the operation should be kept or not.

§

Shift

A shift operation.

Fields

§op: InstShiftOp

The kind of operation.

§a: InstAddress

The address of the first argument.

§b: InstAddress

The address of the second argument.

§out: Output

Whether the produced value from the operation should be kept or not.

§

AssignArithmetic

Instruction for assigned arithmetic operations.

Fields

§op: InstArithmeticOp

The kind of operation.

§target: InstTarget

The target of the operation.

§rhs: InstAddress

The value being assigned.

§

AssignBitwise

Instruction for assigned bitwise operations.

Fields

§op: InstBitwiseOp

The kind of operation.

§target: InstTarget

The target of the operation.

§rhs: InstAddress

The value being assigned.

§

AssignShift

Instruction for assigned shift operations.

Fields

§op: InstShiftOp

The kind of operation.

§target: InstTarget

The target of the operation.

§rhs: InstAddress

The value being assigned.

§

IterNext

Advance an iterator at the given position.

Fields

§addr: InstAddress

The address of the iterator to advance.

§jump: usize

A relative jump to perform if the iterator could not be advanced.

§out: Output

Where to store the produced value from the iterator.

§

Panic

Cause the VM to panic and error out without a reason.

This should only be used during testing or extreme scenarios that are completely unrecoverable.

Fields

§reason: PanicReason

The reason for the panic.

Implementations§

Source§

impl Inst

Source

pub fn unit(out: Output) -> Self

Construct an instruction to push a unit.

Source

pub fn bool(b: bool, out: Output) -> Self

Construct an instruction to push a boolean.

Source

pub fn char(c: char, out: Output) -> Self

Construct an instruction to push a character.

Source

pub fn signed(v: i64, out: Output) -> Self

Construct an instruction to push an integer.

Source

pub fn unsigned(v: u64, out: Output) -> Self

Construct an instruction to push an unsigned integer.

Source

pub fn float(v: f64, out: Output) -> Self

Construct an instruction to push a float.

Source

pub fn ty(ty: Type, out: Output) -> Self

Construct an instruction to push a type.

Source

pub fn ordering(ordering: Ordering, out: Output) -> Self

Construct an instruction to push an ordering.

Trait Implementations§

Source§

impl Clone for Inst

Source§

fn clone(&self) -> Inst

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 Inst

Source§

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

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

impl<'de> Decode<'de, Binary> for Inst

Source§

fn decode<T0>(_0: &T0::Cx, _1: T0) -> Result<Self, <T0::Cx as Context>::Error>
where T0: Decoder<'de, Mode = Binary>,

Decode the given input.
Source§

impl<'de> Decode<'de, Text> for Inst

Source§

fn decode<T0>(_0: &T0::Cx, _1: T0) -> Result<Self, <T0::Cx as Context>::Error>
where T0: Decoder<'de, Mode = Text>,

Decode the given input.
Source§

impl<'de> Deserialize<'de> for Inst

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

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

impl Display for Inst

Source§

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

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

impl Encode<Binary> for Inst

Source§

fn encode<T0>( &self, _1: &T0::Cx, _0: T0, ) -> Result<<T0 as Encoder>::Ok, <T0 as Encoder>::Error>
where T0: Encoder<Mode = Binary>,

Encode the given output.
Source§

impl Encode<Text> for Inst

Source§

fn encode<T0>( &self, _1: &T0::Cx, _0: T0, ) -> Result<<T0 as Encoder>::Ok, <T0 as Encoder>::Error>
where T0: Encoder<Mode = Text>,

Encode the given output.
Source§

impl Serialize for Inst

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

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

impl TryClone for Inst

Source§

fn try_clone(&self) -> Result<Self>

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 Inst

Auto Trait Implementations§

§

impl Freeze for Inst

§

impl RefUnwindSafe for Inst

§

impl Send for Inst

§

impl Sync for Inst

§

impl Unpin for Inst

§

impl UnwindSafe for Inst

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

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

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§

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

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<M, D> DecodeOwned<M> for D
where D: for<'de> Decode<'de, M>,

Source§

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

Source§

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

Source§

impl<T> MaybeSendSync for T