zingen

Struct MacroAssembler

Source
pub struct MacroAssembler {
    pub(crate) asm: Assembler,
}
Expand description

EVM MacroAssembler.

Fields§

§asm: Assembler

Low level assembler.

Implementations§

Source§

impl MacroAssembler

Source

pub fn _ge(&mut self) -> Result<()>

Greater than or equal comparison.

a b ge -> a b-1 gt(lt)

Using lt due to order of stack.

Source

pub fn _sge(&mut self) -> Result<()>

Greater than or equal comparison.

a b sge -> a b-1 sgt(slt)

Using lt due to order of stack.

Source

pub fn _sle(&mut self) -> Result<()>

Greater than or equal comparison.

a b sge -> a b-1 sgt(slt)

Using lt due to order of stack.

Source

pub fn _le(&mut self) -> Result<()>

Greater than or equal comparison.

a b le -> a b-1 lt(gt)

Using gt due to order of stack.

Source

pub fn _sgt(&mut self) -> Result<()>

Greater than and equal comparison.

Using slt due to order of stack.

Source

pub fn _gt(&mut self) -> Result<()>

Greater than comparison.

Using lt due to order of stack.

Source

pub fn _lt(&mut self) -> Result<()>

less than comparison.

Using gt due to order of stack.

Source

pub fn _slt(&mut self) -> Result<()>

less than or equal comparison.

Using gt due to order of stack.

Source

pub fn _ne(&mut self) -> Result<()>

Sign-agnostic compare unequal.

Source

pub fn _eqz(&mut self) -> Result<()>

Simple not operator

Source§

impl MacroAssembler

Source

pub fn _sstore(&mut self) -> Result<()>

Function sstore from EVM which is not available in WASM.

Source

pub fn _sload(&mut self) -> Result<()>

Function sload from EVM which is not available in WASM.

Source§

impl MacroAssembler

Source

pub fn _max(&mut self) -> Result<()>

Maximum of two values

Source

pub fn _min(&mut self) -> Result<()>

Minimum of two values

Source

pub fn _ceil(&mut self) -> Result<()>

Ceiling operator

Source

pub fn _floor(&mut self) -> Result<()>

Floor operator

Source

pub fn _nearest(&mut self) -> Result<()>

Round to nearest integer, ties to even.

Source

pub fn _sqrt(&mut self) -> Result<()>

Square root

Source

pub fn _abs(&mut self) -> Result<()>

Absolute value

Source

pub fn _neg(&mut self) -> Result<()>

Negation

Source

pub fn _copysign(&mut self) -> Result<()>

If z1 and z2 have the same sign, return z1, otherwise return z1 with negated sign.

Source

pub fn _convert_i32_s(&mut self) -> Result<()>

Convert a signed 32-bit integer to a (32-bit/64-bit) float

Source

pub fn _convert_i32_u(&mut self) -> Result<()>

Convert an unsigned 32-bit integer to a (32-bit/64-bit) float

Source

pub fn _convert_i64_s(&mut self) -> Result<()>

Convert a signed 32-bit integer to a (32-bit/64-bit) float

Source

pub fn _convert_i64_u(&mut self) -> Result<()>

Convert a unsigned 32-bit integer to a (32-bit/64-bit) float

Source

pub fn _trunc(&mut self) -> Result<()>

Round to nearest integer towards zero

Source§

impl MacroAssembler

Source

pub fn _sub(&mut self) -> Result<()>

Sub two numbers.

Source

pub fn _i32_const(&mut self, value: i32) -> Result<()>

Push a 32-bit integer value on the stack.

Source

pub fn _i64_const(&mut self, value: i64) -> Result<()>

Push a 64-bit integer value on the stack.

Source

pub fn _f32_const(&mut self, _value: Ieee32) -> Result<()>

Push a 32-bit float value on the stack.

Source

pub fn _f64_const(&mut self, _value: Ieee64) -> Result<()>

Push a 64-bit float value on the stack.

Source

pub fn _i32_wrap_i64(&mut self) -> Result<()>

wrap a 64-bit integer to a 32-bit integer.

Source

pub fn _i64_extend_i32_s(&mut self) -> Result<()>

Extend a signed 32-bit integer to a 64-bit integer.

Source

pub fn _i64_extend_i32_u(&mut self) -> Result<()>

Extend an unsigned 32-bit integer to a 64-bit integer.

Source

pub fn _f32_demote_f64(&mut self) -> Result<()>

Truncate a 64-bit float to a signed 32-bit integer.

Source

pub fn _f64_promote_f32(&mut self) -> Result<()>

Truncate a 64-bit float to an unsigned 32-bit integer.

Source

pub fn _i32_reinterpret_f32(&mut self) -> Result<()>

Convert a signed 32-bit integer to a 32-bit float.

Source

pub fn _i64_reinterpret_f64(&mut self) -> Result<()>

Convert a signed 64-bit integer to a 64-bit float.

Source

pub fn _f32_reinterpret_i32(&mut self) -> Result<()>

Convert a 32-bit float to a signed 32-bit integer.

Source

pub fn _f64_reinterpret_i64(&mut self) -> Result<()>

Convert a 64-bit float to a signed 64-bit integer.

Source

pub fn _rotl(&mut self) -> Result<()>

sign-agnostic rotate left

Return the result of rotating i1 left by k bits.

Source

pub fn _rotr(&mut self) -> Result<()>

sign-agnostic rotate right

Return the result of rotating i1 right by k bits.

Source

pub fn _clz(&mut self) -> Result<()>

sign-agnostic count leading zero bits

Return the number of leading zero bits in i, all zero bits are considered leading if the value is zero.

Source

pub fn _ctz(&mut self) -> Result<()>

sign-agnostic count leading zero bits

Return the number of leading zero bits in i, all zero bits are considered trailing if the value is zero.

Source

pub fn _popcnt(&mut self) -> Result<()>

sign-agnostic count number of one bits

Return the count of no zero bits in i.

Source

pub fn _trunc_f32(&mut self) -> Result<()>

Truncate a 32-bit float to an integer

Source

pub fn _trunc_f64(&mut self) -> Result<()>

Truncate a 64-bit float to an integer

Source§

impl MacroAssembler

Source

pub(crate) fn _load(&mut self) -> Result<()>

Load n bytes to extend self as another number type.

Just for adapting the WASM instructions, this method makes no sense for EVM since all of the numbers as U256.

Source

pub(crate) fn _load8(&mut self) -> Result<()>

Load 1 byte to extend self as another number type.

Just for adapting the WASM instructions, this method makes no sense for EVM since all of the numbers as U256.

Source

pub(crate) fn _load16(&mut self) -> Result<()>

Load 2 bytes to extend self as another number type.

Just for adapting the WASM instructions, this method makes no sense for EVM since all of the numbers as U256.

Source

pub(crate) fn _load32(&mut self) -> Result<()>

Load 4 bytes to extend self as another number type.

Just for adapting the WASM instructions, this method makes no sense for EVM since all of the numbers as U256.

Source

pub fn _store(&mut self) -> Result<()>

Store n bytes in memory.

Source

pub fn _store8(&mut self) -> Result<()>

Wrap self to i8 and store 1 byte

Source

pub fn _store16(&mut self) -> Result<()>

Wrap self to i16 and store 2 bytes

Source

pub fn _store32(&mut self) -> Result<()>

Wrap self to i32 and store 4 bytes

Source

pub fn _memory_size(&mut self, _: u32, _: u8) -> Result<()>

The memory size instruction returns the current size of memory.

Source

pub fn _memory_grow(&mut self, _: u32, _: u8) -> Result<()>

The memory grow instruction grows memory by a given delta and returns the previous size, or -1 if enough memory cannot be allocated.

Source§

impl MacroAssembler

Source

pub(crate) fn handle_empty_return(&mut self) -> Result<()>

Return with nothing.

Source

pub fn main_return(&mut self, results: &[ValType]) -> Result<()>

Handle the end of the main function.

Source

pub fn call_return(&mut self, results: &[ValType]) -> Result<()>

Handle the return of a call.

Source§

impl MacroAssembler

Source

pub fn _drop(&mut self) -> Result<()>

The drop instruction simply throw away a single operand.

Source§

impl MacroAssembler

Source

pub fn memory_write(&mut self, ty: impl Type) -> Result<MemoryInfo>

Store data in memory with at current memory byte pointer.

Source

pub fn memory_write_bytes(&mut self, bytes: &[u8]) -> Result<MemoryInfo>

Write bytes to memory.

Source

pub fn memory_write_at(&mut self, offset: &[u8]) -> Result<()>

Store data in memory at offset.

Returns the size in the lowest significant bytes.

Source

pub fn pc(&self) -> u16

Get the current program counter offset.

Source

pub fn pc_offset(&self) -> u16

Get the current program counter offset.

Source

pub fn push(&mut self, bytes: &[u8]) -> Result<()>

Place n bytes on stack.

Source

pub fn mp_offset<F>(&self, f: F) -> Result<SmallVec<[u8; 8]>>
where F: Fn(usize) -> Result<usize>,

Get byte offset of the memory pointer.

Source

pub fn sp(&self) -> u16

Get the stack pointer.

Source

pub fn swap(&mut self, index: u16) -> Result<()>

Swap memory by target index.

Source

pub fn dup(&mut self, index: u16) -> Result<()>

Duplicate stack item by target index.

Source

pub fn shift_stack(&mut self, count: u16, from_top: bool) -> Result<()>

Shift the program counter to the bottom or the top of the parameters. This is used by the callee function for jumping back to the caller function.

Source

pub fn _return(&mut self) -> Result<()>

Return zero or more values from the function.

The return instruction is a shortcut for an unconditional branch to the outermost block, which implicitly is the body of the current function.

NOTE: This return could be different from the return in the EVM.

Methods from Deref<Target = Assembler>§

Source

pub fn buffer(&self) -> &[u8]

Buffer of the assembler.

Source

pub fn buffer_mut(&mut self) -> &mut Buffer

Mutable buffer of the assembler.

Source

pub fn increment_gas(&mut self, gas: u128)

Increment the gas counter.

TODO: use number bigger than u256 for throwing proper errors. (#21)

Source

pub fn increment_sp(&mut self, items: u16) -> Result<()>

Increment stack pointer

Source

pub fn decrement_sp(&mut self, items: u16) -> Result<()>

Decrement stack pointer

Source

pub fn increment_mp(&mut self, offset: usize) -> Result<()>

Increment memory pointer

Source

pub fn decrement_mp(&mut self, offset: usize) -> Result<()>

Decrement memory pointer

Source

pub fn emit(&mut self, byte: u8)

Emit a byte.

Source

pub fn emitn(&mut self, bytes: &[u8])

Emit n bytes.

Source

pub fn emit_op(&mut self, opcode: OpCode) -> Result<()>

Emit a single opcode.

Mock the stack input and output for checking the stack usages.

Source

pub fn _stop(&mut self) -> Result<()>

Emit STOP

Source

pub fn _add(&mut self) -> Result<()>

Emit ADD

Source

pub fn _mul(&mut self) -> Result<()>

Emit MUL

Source

pub fn _sub(&mut self) -> Result<()>

Emit SUB

Source

pub fn _div(&mut self) -> Result<()>

Emit DIV

Source

pub fn _sdiv(&mut self) -> Result<()>

Emit SDIV

Source

pub fn _mod(&mut self) -> Result<()>

Emit MOD

Source

pub fn _smod(&mut self) -> Result<()>

Emit SMOD

Source

pub fn _addmod(&mut self) -> Result<()>

Emit ADDMOD

Source

pub fn _mulmod(&mut self) -> Result<()>

Emit MULMOD

Source

pub fn _exp(&mut self) -> Result<()>

Emit EXP

Source

pub fn _signextend(&mut self) -> Result<()>

Emit SIGNEXTEND

Source

pub fn _lt(&mut self) -> Result<()>

Emit LT

Source

pub fn _gt(&mut self) -> Result<()>

Emit GT

Source

pub fn _slt(&mut self) -> Result<()>

Emit SLT

Source

pub fn _sgt(&mut self) -> Result<()>

Emit SGT

Source

pub fn _eq(&mut self) -> Result<()>

Emit EQ

Source

pub fn _iszero(&mut self) -> Result<()>

Emit ISZERO

Source

pub fn _and(&mut self) -> Result<()>

Emit AND

Source

pub fn _or(&mut self) -> Result<()>

Emit OR

Source

pub fn _xor(&mut self) -> Result<()>

Emit XOR

Source

pub fn _not(&mut self) -> Result<()>

Emit NOT

Source

pub fn _byte(&mut self) -> Result<()>

Emit BYTE

Source

pub fn _shl(&mut self) -> Result<()>

Emit SHL

Source

pub fn _shr(&mut self) -> Result<()>

Emit SHR

Source

pub fn _sar(&mut self) -> Result<()>

Emit SAR

Source

pub fn _keccak256(&mut self) -> Result<()>

Emit KECCAK256

Source

pub fn _address(&mut self) -> Result<()>

Emit ADDRESS

Source

pub fn _balance(&mut self) -> Result<()>

Emit BALANCE

Source

pub fn _origin(&mut self) -> Result<()>

Emit ORIGIN

Source

pub fn _caller(&mut self) -> Result<()>

Emit CALLER

Source

pub fn _callvalue(&mut self) -> Result<()>

Emit CALLVALUE

Source

pub fn _calldataload(&mut self) -> Result<()>

Emit CALLDATALOAD

Source

pub fn _calldatasize(&mut self) -> Result<()>

Emit CALLDATASIZE

Source

pub fn _calldatacopy(&mut self) -> Result<()>

Emit CALLDATACOPY

Source

pub fn _codesize(&mut self) -> Result<()>

Emit CODESIZE

Source

pub fn _codecopy(&mut self) -> Result<()>

Emit CODECOPY

Source

pub fn _gasprice(&mut self) -> Result<()>

Emit GASPRICE

Source

pub fn _extcodesize(&mut self) -> Result<()>

Emit EXTCODESIZE

Source

pub fn _extcodecopy(&mut self) -> Result<()>

Emit EXTCODECOPY

Source

pub fn _returndatasize(&mut self) -> Result<()>

Emit RETURNDATASIZE

Source

pub fn _returndatacopy(&mut self) -> Result<()>

Emit RETURNDATACOPY

Source

pub fn _extcodehash(&mut self) -> Result<()>

Emit EXTCODEHASH

Source

pub fn _blockhash(&mut self) -> Result<()>

Emit BLOCKHASH

Source

pub fn _coinbase(&mut self) -> Result<()>

Emit COINBASE

Source

pub fn _timestamp(&mut self) -> Result<()>

Emit TIMESTAMP

Source

pub fn _number(&mut self) -> Result<()>

Emit NUMBER

Source

pub fn _difficulty(&mut self) -> Result<()>

Emit DIFFICULTY

Source

pub fn _gaslimit(&mut self) -> Result<()>

Emit GASLIMIT

Source

pub fn _chainid(&mut self) -> Result<()>

Emit CHAINID

Source

pub fn _selfbalance(&mut self) -> Result<()>

Emit SELFBALANCE

Source

pub fn _basefee(&mut self) -> Result<()>

Emit BASEFEE

Source

pub fn _blobhash(&mut self) -> Result<()>

Emit BLOBHASH

Source

pub fn _blobbasefee(&mut self) -> Result<()>

Emit BLOBBASEFEE

Source

pub fn _pop(&mut self) -> Result<()>

Emit POP

Source

pub fn _mload(&mut self) -> Result<()>

Emit MLOAD

Source

pub fn _mstore(&mut self) -> Result<()>

Emit MSTORE

Source

pub fn _mstore8(&mut self) -> Result<()>

Emit MSTORE8

Source

pub fn _sload(&mut self) -> Result<()>

Emit SLOAD

Source

pub fn _sstore(&mut self) -> Result<()>

Emit SSTORE

Source

pub fn _jump(&mut self) -> Result<()>

Emit JUMP

Source

pub fn _jumpi(&mut self) -> Result<()>

Emit JUMPI

Source

pub fn _pc(&mut self) -> Result<()>

Emit PC

Source

pub fn _msize(&mut self) -> Result<()>

Emit MSIZE

Source

pub fn _gas(&mut self) -> Result<()>

Emit GAS

Source

pub fn _jumpdest(&mut self) -> Result<()>

Emit JUMPDEST

Source

pub fn _tload(&mut self) -> Result<()>

Emit TLOAD

Source

pub fn _tstore(&mut self) -> Result<()>

Emit TSTORE

Source

pub fn _mcopy(&mut self) -> Result<()>

Emit MCOPY

Source

pub fn _push0(&mut self) -> Result<()>

Emit PUSH0

Source

pub fn _push1(&mut self) -> Result<()>

Emit PUSH1

Source

pub fn _push2(&mut self) -> Result<()>

Emit PUSH2

Source

pub fn _push3(&mut self) -> Result<()>

Emit PUSH3

Source

pub fn _push4(&mut self) -> Result<()>

Emit PUSH4

Source

pub fn _push5(&mut self) -> Result<()>

Emit PUSH5

Source

pub fn _push6(&mut self) -> Result<()>

Emit PUSH6

Source

pub fn _push7(&mut self) -> Result<()>

Emit PUSH7

Source

pub fn _push8(&mut self) -> Result<()>

Emit PUSH8

Source

pub fn _push9(&mut self) -> Result<()>

Emit PUSH9

Source

pub fn _push10(&mut self) -> Result<()>

Emit PUSH10

Source

pub fn _push11(&mut self) -> Result<()>

Emit PUSH11

Source

pub fn _push12(&mut self) -> Result<()>

Emit PUSH12

Source

pub fn _push13(&mut self) -> Result<()>

Emit PUSH13

Source

pub fn _push14(&mut self) -> Result<()>

Emit PUSH14

Source

pub fn _push15(&mut self) -> Result<()>

Emit PUSH15

Source

pub fn _push16(&mut self) -> Result<()>

Emit PUSH16

Source

pub fn _push17(&mut self) -> Result<()>

Emit PUSH17

Source

pub fn _push18(&mut self) -> Result<()>

Emit PUSH18

Source

pub fn _push19(&mut self) -> Result<()>

Emit PUSH19

Source

pub fn _push20(&mut self) -> Result<()>

Emit PUSH20

Source

pub fn _push21(&mut self) -> Result<()>

Emit PUSH21

Source

pub fn _push22(&mut self) -> Result<()>

Emit PUSH22

Source

pub fn _push23(&mut self) -> Result<()>

Emit PUSH23

Source

pub fn _push24(&mut self) -> Result<()>

Emit PUSH24

Source

pub fn _push25(&mut self) -> Result<()>

Emit PUSH25

Source

pub fn _push26(&mut self) -> Result<()>

Emit PUSH26

Source

pub fn _push27(&mut self) -> Result<()>

Emit PUSH27

Source

pub fn _push28(&mut self) -> Result<()>

Emit PUSH28

Source

pub fn _push29(&mut self) -> Result<()>

Emit PUSH29

Source

pub fn _push30(&mut self) -> Result<()>

Emit PUSH30

Source

pub fn _push31(&mut self) -> Result<()>

Emit PUSH31

Source

pub fn _push32(&mut self) -> Result<()>

Emit PUSH32

Source

pub fn _dup1(&mut self) -> Result<()>

Emit DUP1

Source

pub fn _dup2(&mut self) -> Result<()>

Emit DUP2

Source

pub fn _dup3(&mut self) -> Result<()>

Emit DUP3

Source

pub fn _dup4(&mut self) -> Result<()>

Emit DUP4

Source

pub fn _dup5(&mut self) -> Result<()>

Emit DUP5

Source

pub fn _dup6(&mut self) -> Result<()>

Emit DUP6

Source

pub fn _dup7(&mut self) -> Result<()>

Emit DUP7

Source

pub fn _dup8(&mut self) -> Result<()>

Emit DUP8

Source

pub fn _dup9(&mut self) -> Result<()>

Emit DUP9

Source

pub fn _dup10(&mut self) -> Result<()>

Emit DUP10

Source

pub fn _dup11(&mut self) -> Result<()>

Emit DUP11

Source

pub fn _dup12(&mut self) -> Result<()>

Emit DUP12

Source

pub fn _dup13(&mut self) -> Result<()>

Emit DUP13

Source

pub fn _dup14(&mut self) -> Result<()>

Emit DUP14

Source

pub fn _dup15(&mut self) -> Result<()>

Emit DUP15

Source

pub fn _dup16(&mut self) -> Result<()>

Emit DUP16

Source

pub fn _swap1(&mut self) -> Result<()>

Emit SWAP1

Source

pub fn _swap2(&mut self) -> Result<()>

Emit SWAP2

Source

pub fn _swap3(&mut self) -> Result<()>

Emit SWAP3

Source

pub fn _swap4(&mut self) -> Result<()>

Emit SWAP4

Source

pub fn _swap5(&mut self) -> Result<()>

Emit SWAP5

Source

pub fn _swap6(&mut self) -> Result<()>

Emit SWAP6

Source

pub fn _swap7(&mut self) -> Result<()>

Emit SWAP7

Source

pub fn _swap8(&mut self) -> Result<()>

Emit SWAP8

Source

pub fn _swap9(&mut self) -> Result<()>

Emit SWAP9

Source

pub fn _swap10(&mut self) -> Result<()>

Emit SWAP10

Source

pub fn _swap11(&mut self) -> Result<()>

Emit SWAP11

Source

pub fn _swap12(&mut self) -> Result<()>

Emit SWAP12

Source

pub fn _swap13(&mut self) -> Result<()>

Emit SWAP13

Source

pub fn _swap14(&mut self) -> Result<()>

Emit SWAP14

Source

pub fn _swap15(&mut self) -> Result<()>

Emit SWAP15

Source

pub fn _swap16(&mut self) -> Result<()>

Emit SWAP16

Source

pub fn _log0(&mut self) -> Result<()>

Emit LOG0

Source

pub fn _log1(&mut self) -> Result<()>

Emit LOG1

Source

pub fn _log2(&mut self) -> Result<()>

Emit LOG2

Source

pub fn _log3(&mut self) -> Result<()>

Emit LOG3

Source

pub fn _log4(&mut self) -> Result<()>

Emit LOG4

Source

pub fn _create(&mut self) -> Result<()>

Emit CREATE

Source

pub fn _call(&mut self) -> Result<()>

Emit CALL

Source

pub fn _callcode(&mut self) -> Result<()>

Emit CALLCODE

Source

pub fn _return(&mut self) -> Result<()>

Emit RETURN

Source

pub fn _delegatecall(&mut self) -> Result<()>

Emit DELEGATECALL

Source

pub fn _create2(&mut self) -> Result<()>

Emit CREATE2

Source

pub fn _staticcall(&mut self) -> Result<()>

Emit STATICCALL

Source

pub fn _revert(&mut self) -> Result<()>

Emit REVERT

Source

pub fn _invalid(&mut self) -> Result<()>

Emit INVALID

Source

pub fn _selfdestruct(&mut self) -> Result<()>

Emit SELFDESTRUCT

Trait Implementations§

Source§

impl Clone for MacroAssembler

Source§

fn clone(&self) -> MacroAssembler

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 MacroAssembler

Source§

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

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

impl Default for MacroAssembler

Source§

fn default() -> MacroAssembler

Returns the “default value” for a type. Read more
Source§

impl Deref for MacroAssembler

Source§

type Target = Assembler

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for MacroAssembler

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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