pub enum Bytecode {
Show 71 variants Pop, Ret, BrTrue(CodeOffset), BrFalse(CodeOffset), Branch(CodeOffset), LdU8(u8), LdU64(u64), LdU128(u128), CastU8, CastU64, CastU128, LdConst(ConstantPoolIndex), LdTrue, LdFalse, CopyLoc(LocalIndex), MoveLoc(LocalIndex), StLoc(LocalIndex), Call(FunctionHandleIndex), CallGeneric(FunctionInstantiationIndex), Pack(StructDefinitionIndex), PackGeneric(StructDefInstantiationIndex), Unpack(StructDefinitionIndex), UnpackGeneric(StructDefInstantiationIndex), ReadRef, WriteRef, FreezeRef, MutBorrowLoc(LocalIndex), ImmBorrowLoc(LocalIndex), MutBorrowField(FieldHandleIndex), MutBorrowFieldGeneric(FieldInstantiationIndex), ImmBorrowField(FieldHandleIndex), ImmBorrowFieldGeneric(FieldInstantiationIndex), MutBorrowGlobal(StructDefinitionIndex), MutBorrowGlobalGeneric(StructDefInstantiationIndex), ImmBorrowGlobal(StructDefinitionIndex), ImmBorrowGlobalGeneric(StructDefInstantiationIndex), Add, Sub, Mul, Mod, Div, BitOr, BitAnd, Xor, Or, And, Not, Eq, Neq, Lt, Gt, Le, Ge, Abort, Nop, Exists(StructDefinitionIndex), ExistsGeneric(StructDefInstantiationIndex), MoveFrom(StructDefinitionIndex), MoveFromGeneric(StructDefInstantiationIndex), MoveTo(StructDefinitionIndex), MoveToGeneric(StructDefInstantiationIndex), Shl, Shr, VecPack(SignatureIndex, u64), VecLen(SignatureIndex), VecImmBorrow(SignatureIndex), VecMutBorrow(SignatureIndex), VecPushBack(SignatureIndex), VecPopBack(SignatureIndex), VecUnpack(SignatureIndex, u64), VecSwap(SignatureIndex),
}
Expand description

Bytecode is a VM instruction of variable size. The type of the bytecode (opcode) defines the size of the bytecode.

Bytecodes operate on a stack machine and each bytecode has side effect on the stack and the instruction stream.

Variants§

§

Pop

Pop and discard the value at the top of the stack. The value on the stack must be an copyable type.

Stack transition:

..., value -> ...

§

Ret

Return from function, possibly with values according to the return types in the function signature. The returned values are pushed on the stack. The function signature of the function being executed defines the semantic of the Ret opcode.

Stack transition:

..., arg_val(1), ..., arg_val(n) -> ..., return_val(1), ..., return_val(n)

§

BrTrue(CodeOffset)

Branch to the instruction at position CodeOffset if the value at the top of the stack is true. Code offsets are relative to the start of the instruction stream.

Stack transition:

..., bool_value -> ...

§

BrFalse(CodeOffset)

Branch to the instruction at position CodeOffset if the value at the top of the stack is false. Code offsets are relative to the start of the instruction stream.

Stack transition:

..., bool_value -> ...

§

Branch(CodeOffset)

Branch unconditionally to the instruction at position CodeOffset. Code offsets are relative to the start of the instruction stream.

Stack transition: none

§

LdU8(u8)

Push a U8 constant onto the stack.

Stack transition:

... -> ..., u8_value

§

LdU64(u64)

Push a U64 constant onto the stack.

Stack transition:

... -> ..., u64_value

§

LdU128(u128)

Push a U128 constant onto the stack.

Stack transition:

... -> ..., u128_value

§

CastU8

Convert the value at the top of the stack into u8.

Stack transition:

..., integer_value -> ..., u8_value

§

CastU64

Convert the value at the top of the stack into u64.

Stack transition:

..., integer_value -> ..., u8_value

§

CastU128

Convert the value at the top of the stack into u128.

Stack transition:

..., integer_value -> ..., u128_value

§

LdConst(ConstantPoolIndex)

Push a Constant onto the stack. The value is loaded and deserialized (according to its type) from the the ConstantPool via ConstantPoolIndex

Stack transition:

... -> ..., value

§

LdTrue

Push true onto the stack.

Stack transition:

... -> ..., true

§

LdFalse

Push false onto the stack.

Stack transition:

... -> ..., false

§

CopyLoc(LocalIndex)

Push the local identified by LocalIndex onto the stack. The value is copied and the local is still safe to use.

Stack transition:

... -> ..., value

§

MoveLoc(LocalIndex)

Push the local identified by LocalIndex onto the stack. The local is moved and it is invalid to use from that point on, unless a store operation writes to the local before any read to that local.

Stack transition:

... -> ..., value

§

StLoc(LocalIndex)

Pop value from the top of the stack and store it into the function locals at position LocalIndex.

Stack transition:

..., value -> ...

§

Call(FunctionHandleIndex)

Call a function. The stack has the arguments pushed first to last. The arguments are consumed and pushed to the locals of the function. Return values are pushed on the stack and available to the caller.

Stack transition:

return_value(k)```
§

CallGeneric(FunctionInstantiationIndex)

§

Pack(StructDefinitionIndex)

Create an instance of the type specified via StructHandleIndex and push it on the stack. The values of the fields of the struct, in the order they appear in the struct declaration, must be pushed on the stack. All fields must be provided.

A Pack instruction must fully initialize an instance.

Stack transition:

..., field(1)_value, field(2)_value, ..., field(n)_value -> ..., instance_value

§

PackGeneric(StructDefInstantiationIndex)

§

Unpack(StructDefinitionIndex)

Destroy an instance of a type and push the values bound to each field on the stack.

The values of the fields of the instance appear on the stack in the order defined in the struct definition.

This order makes Unpack the inverse of Pack. So Unpack<T>; Pack<T> is the identity for struct T.

Stack transition:

..., instance_value -> ..., field(1)_value, field(2)_value, ..., field(n)_value

§

UnpackGeneric(StructDefInstantiationIndex)

§

ReadRef

Read a reference. The reference is on the stack, it is consumed and the value read is pushed on the stack.

Reading a reference performs a copy of the value referenced. As such, ReadRef requires that the type of the value has the Copy ability.

Stack transition:

..., reference_value -> ..., value

§

WriteRef

Write to a reference. The reference and the value are on the stack and are consumed.

WriteRef requires that the type of the value has the Drop ability as the previous value is lost

Stack transition:

..., value, reference_value -> ...

§

FreezeRef

Convert a mutable reference to an immutable reference.

Stack transition:

..., reference_value -> ..., reference_value

§

MutBorrowLoc(LocalIndex)

Load a mutable reference to a local identified by LocalIndex.

The local must not be a reference.

Stack transition:

... -> ..., reference

§

ImmBorrowLoc(LocalIndex)

Load an immutable reference to a local identified by LocalIndex.

The local must not be a reference.

Stack transition:

... -> ..., reference

§

MutBorrowField(FieldHandleIndex)

Load a mutable reference to a field identified by FieldHandleIndex. The top of the stack must be a mutable reference to a type that contains the field definition.

Stack transition:

..., reference -> ..., field_reference

§

MutBorrowFieldGeneric(FieldInstantiationIndex)

Load a mutable reference to a field identified by FieldInstantiationIndex. The top of the stack must be a mutable reference to a type that contains the field definition.

Stack transition:

..., reference -> ..., field_reference

§

ImmBorrowField(FieldHandleIndex)

Load an immutable reference to a field identified by FieldHandleIndex. The top of the stack must be a reference to a type that contains the field definition.

Stack transition:

..., reference -> ..., field_reference

§

ImmBorrowFieldGeneric(FieldInstantiationIndex)

Load an immutable reference to a field identified by FieldInstantiationIndex. The top of the stack must be a reference to a type that contains the field definition.

Stack transition:

..., reference -> ..., field_reference

§

MutBorrowGlobal(StructDefinitionIndex)

Return a mutable reference to an instance of type StructDefinitionIndex published at the address passed as argument. Abort execution if such an object does not exist or if a reference has already been handed out.

Stack transition:

..., address_value -> ..., reference_value

§

MutBorrowGlobalGeneric(StructDefInstantiationIndex)

§

ImmBorrowGlobal(StructDefinitionIndex)

Return an immutable reference to an instance of type StructDefinitionIndex published at the address passed as argument. Abort execution if such an object does not exist or if a reference has already been handed out.

Stack transition:

..., address_value -> ..., reference_value

§

ImmBorrowGlobalGeneric(StructDefInstantiationIndex)

§

Add

Add the 2 u64 at the top of the stack and pushes the result on the stack. The operation aborts the transaction in case of overflow.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

Sub

Subtract the 2 u64 at the top of the stack and pushes the result on the stack. The operation aborts the transaction in case of underflow.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

Mul

Multiply the 2 u64 at the top of the stack and pushes the result on the stack. The operation aborts the transaction in case of overflow.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

Mod

Perform a modulo operation on the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

Div

Divide the 2 u64 at the top of the stack and pushes the result on the stack. The operation aborts the transaction in case of “divide by 0”.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

BitOr

Bitwise OR the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

BitAnd

Bitwise AND the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

Xor

Bitwise XOR the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

Or

Logical OR the 2 bool at the top of the stack and pushes the result on the stack.

Stack transition:

..., bool_value(1), bool_value(2) -> ..., bool_value

§

And

Logical AND the 2 bool at the top of the stack and pushes the result on the stack.

Stack transition:

..., bool_value(1), bool_value(2) -> ..., bool_value

§

Not

Logical NOT the bool at the top of the stack and pushes the result on the stack.

Stack transition:

..., bool_value -> ..., bool_value

§

Eq

Compare for equality the 2 value at the top of the stack and pushes the result on the stack. The values on the stack must have Drop as they will be consumed and destroyed.

Stack transition:

..., value(1), value(2) -> ..., bool_value

§

Neq

Compare for inequality the 2 value at the top of the stack and pushes the result on the stack. The values on the stack must have Drop as they will be consumed and destroyed.

Stack transition:

..., value(1), value(2) -> ..., bool_value

§

Lt

Perform a “less than” operation of the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., bool_value

§

Gt

Perform a “greater than” operation of the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., bool_value

§

Le

Perform a “less than or equal” operation of the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., bool_value

§

Ge

Perform a “greater than or equal” than operation of the 2 u64 at the top of the stack and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., bool_value

§

Abort

Abort execution with errorcode

Stack transition:

..., errorcode -> ...

§

Nop

No operation.

Stack transition: none

§

Exists(StructDefinitionIndex)

Returns whether or not a given address has an object of type StructDefinitionIndex published already

Stack transition:

..., address_value -> ..., bool_value

§

ExistsGeneric(StructDefInstantiationIndex)

§

MoveFrom(StructDefinitionIndex)

Move the instance of type StructDefinitionIndex, at the address at the top of the stack. Abort execution if such an object does not exist.

Stack transition:

..., address_value -> ..., value

§

MoveFromGeneric(StructDefInstantiationIndex)

§

MoveTo(StructDefinitionIndex)

Move the instance at the top of the stack to the address of the Signer on the stack below it Abort execution if an object of type StructDefinitionIndex already exists in address.

Stack transition:

..., signer_value, value -> ...

§

MoveToGeneric(StructDefInstantiationIndex)

§

Shl

Shift the (second top value) left (top value) bits and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

Shr

Shift the (second top value) right (top value) bits and pushes the result on the stack.

Stack transition:

..., u64_value(1), u64_value(2) -> ..., u64_value

§

VecPack(SignatureIndex, u64)

Create a vector by packing a statically known number of elements from the stack. Abort the execution if there are not enough number of elements on the stack to pack from or they don’t have the same type identified by the SignatureIndex.

Stack transition:

..., e1, e2, ..., eN -> ..., vec[e1, e2, ..., eN]

§

VecLen(SignatureIndex)

Return the length of the vector,

Stack transition:

..., vector_reference -> ..., u64_value

§

VecImmBorrow(SignatureIndex)

Acquire an immutable reference to the element at a given index of the vector. Abort the execution if the index is out of bounds.

Stack transition:

..., vector_reference, u64_value -> .., element_reference

§

VecMutBorrow(SignatureIndex)

Acquire a mutable reference to the element at a given index of the vector. Abort the execution if the index is out of bounds.

Stack transition:

..., vector_reference, u64_value -> .., element_reference

§

VecPushBack(SignatureIndex)

Add an element to the end of the vector.

Stack transition:

..., vector_reference, element -> ...

§

VecPopBack(SignatureIndex)

Pop an element from the end of vector. Aborts if the vector is empty.

Stack transition:

..., vector_reference -> ..., element

§

VecUnpack(SignatureIndex, u64)

Destroy the vector and unpack a statically known number of elements onto the stack. Aborts if the vector does not have a length N.

Stack transition:

..., vec[e1, e2, ..., eN] -> ..., e1, e2, ..., eN

§

VecSwap(SignatureIndex)

Swaps the elements at two indices in the vector. Abort the execution if any of the indice is out of bounds.

..., vector_reference, u64_value(1), u64_value(2) -> ...

Implementations§

source§

impl Bytecode

source

pub const VARIANT_COUNT: usize = 71usize

source§

impl Bytecode

source

pub fn is_unconditional_branch(&self) -> bool

Return true if this bytecode instruction always branches

source

pub fn is_conditional_branch(&self) -> bool

Return true if the branching behavior of this bytecode instruction depends on a runtime value

source

pub fn is_branch(&self) -> bool

Returns true if this bytecode instruction is either a conditional or an unconditional branch

source

pub fn offset(&self) -> Option<&CodeOffset>

Returns the offset that this bytecode instruction branches to, if any. Note that return and abort are branch instructions, but have no offset.

source

pub fn get_successors(pc: CodeOffset, code: &[Bytecode]) -> Vec<CodeOffset>

Return the successor offsets of this bytecode instruction.

Trait Implementations§

source§

impl Arbitrary for Bytecode

§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = TupleUnion<((u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<Map<<u16 as Arbitrary>::Strategy, fn(_: u16) -> Bytecode>>), (u32, Arc<Map<<u16 as Arbitrary>::Strategy, fn(_: u16) -> Bytecode>>), (u32, Arc<Map<<u16 as Arbitrary>::Strategy, fn(_: u16) -> Bytecode>>), (u32, Arc<Map<<u8 as Arbitrary>::Strategy, fn(_: u8) -> Bytecode>>), (u32, Arc<Map<<u64 as Arbitrary>::Strategy, fn(_: u64) -> Bytecode>>), (u32, Arc<Map<<u128 as Arbitrary>::Strategy, fn(_: u128) -> Bytecode>>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<TupleUnion<((u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<Map<<ConstantPoolIndex as Arbitrary>::Strategy, fn(_: ConstantPoolIndex) -> Bytecode>>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<Map<<u8 as Arbitrary>::Strategy, fn(_: u8) -> Bytecode>>), (u32, Arc<Map<<u8 as Arbitrary>::Strategy, fn(_: u8) -> Bytecode>>), (u32, Arc<Map<<u8 as Arbitrary>::Strategy, fn(_: u8) -> Bytecode>>), (u32, Arc<Map<<FunctionHandleIndex as Arbitrary>::Strategy, fn(_: FunctionHandleIndex) -> Bytecode>>), (u32, Arc<TupleUnion<((u32, Arc<Map<<FunctionInstantiationIndex as Arbitrary>::Strategy, fn(_: FunctionInstantiationIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefinitionIndex as Arbitrary>::Strategy, fn(_: StructDefinitionIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefInstantiationIndex as Arbitrary>::Strategy, fn(_: StructDefInstantiationIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefinitionIndex as Arbitrary>::Strategy, fn(_: StructDefinitionIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefInstantiationIndex as Arbitrary>::Strategy, fn(_: StructDefInstantiationIndex) -> Bytecode>>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<Map<<u8 as Arbitrary>::Strategy, fn(_: u8) -> Bytecode>>), (u32, Arc<TupleUnion<((u32, Arc<Map<<u8 as Arbitrary>::Strategy, fn(_: u8) -> Bytecode>>), (u32, Arc<Map<<FieldHandleIndex as Arbitrary>::Strategy, fn(_: FieldHandleIndex) -> Bytecode>>), (u32, Arc<Map<<FieldInstantiationIndex as Arbitrary>::Strategy, fn(_: FieldInstantiationIndex) -> Bytecode>>), (u32, Arc<Map<<FieldHandleIndex as Arbitrary>::Strategy, fn(_: FieldHandleIndex) -> Bytecode>>), (u32, Arc<Map<<FieldInstantiationIndex as Arbitrary>::Strategy, fn(_: FieldInstantiationIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefinitionIndex as Arbitrary>::Strategy, fn(_: StructDefinitionIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefInstantiationIndex as Arbitrary>::Strategy, fn(_: StructDefInstantiationIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefinitionIndex as Arbitrary>::Strategy, fn(_: StructDefinitionIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefInstantiationIndex as Arbitrary>::Strategy, fn(_: StructDefInstantiationIndex) -> Bytecode>>), (u32, Arc<TupleUnion<((u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<TupleUnion<((u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<TupleUnion<((u32, Arc<fn() -> Bytecode>), (u32, Arc<Map<<StructDefinitionIndex as Arbitrary>::Strategy, fn(_: StructDefinitionIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefInstantiationIndex as Arbitrary>::Strategy, fn(_: StructDefInstantiationIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefinitionIndex as Arbitrary>::Strategy, fn(_: StructDefinitionIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefInstantiationIndex as Arbitrary>::Strategy, fn(_: StructDefInstantiationIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefinitionIndex as Arbitrary>::Strategy, fn(_: StructDefinitionIndex) -> Bytecode>>), (u32, Arc<Map<<StructDefInstantiationIndex as Arbitrary>::Strategy, fn(_: StructDefInstantiationIndex) -> Bytecode>>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<fn() -> Bytecode>), (u32, Arc<TupleUnion<((u32, Arc<Map<(<SignatureIndex as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy), fn(_: (SignatureIndex, u64)) -> Bytecode>>), (u32, Arc<Map<<SignatureIndex as Arbitrary>::Strategy, fn(_: SignatureIndex) -> Bytecode>>), (u32, Arc<Map<<SignatureIndex as Arbitrary>::Strategy, fn(_: SignatureIndex) -> Bytecode>>), (u32, Arc<Map<<SignatureIndex as Arbitrary>::Strategy, fn(_: SignatureIndex) -> Bytecode>>), (u32, Arc<Map<<SignatureIndex as Arbitrary>::Strategy, fn(_: SignatureIndex) -> Bytecode>>), (u32, Arc<Map<<SignatureIndex as Arbitrary>::Strategy, fn(_: SignatureIndex) -> Bytecode>>), (u32, Arc<Map<(<SignatureIndex as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy), fn(_: (SignatureIndex, u64)) -> Bytecode>>), (u32, Arc<Map<<SignatureIndex as Arbitrary>::Strategy, fn(_: SignatureIndex) -> Bytecode>>))>>))>>))>>))>>))>>))>>))>>))>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl Clone for Bytecode

source§

fn clone(&self) -> Bytecode

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 Bytecode

source§

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

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

impl Hash for Bytecode

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 PartialEq<Bytecode> for Bytecode

source§

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

source§

impl StructuralEq for Bytecode

source§

impl StructuralPartialEq for Bytecode

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> ToOwned for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V