Struct revm_interpreter::opcode::OpCode

source ·
pub struct OpCode(/* private fields */);
Expand description

An EVM opcode.

This is always a valid opcode, as declared in the opcode module or the OPCODE_INFO_JUMPTABLE constant.

Implementations§

source§

impl OpCode

source

pub const fn new(opcode: u8) -> Option<Self>

Instantiate a new opcode from a u8.

source

pub fn parse(s: &str) -> Option<Self>

Parses an opcode from a string. This is the inverse of as_str.

source

pub const fn is_jumpdest(&self) -> bool

Returns true if the opcode is a jump destination.

source

pub const fn is_jumpdest_by_op(opcode: u8) -> bool

Takes a u8 and returns true if it is a jump destination.

source

pub const fn is_jump(self) -> bool

Returns true if the opcode is a legacy jump instruction.

source

pub const fn is_jump_by_op(opcode: u8) -> bool

Takes a u8 and returns true if it is a jump instruction.

source

pub const fn is_push(self) -> bool

Returns true if the opcode is a PUSH instruction.

source

pub fn is_push_by_op(opcode: u8) -> bool

Takes a u8 and returns true if it is a push instruction.

source

pub unsafe fn new_unchecked(opcode: u8) -> Self

Instantiate a new opcode from a u8 without checking if it is valid.

§Safety

All code using Opcode values assume that they are valid opcodes, so providing an invalid opcode may cause undefined behavior.

source

pub const fn as_str(self) -> &'static str

Returns the opcode as a string. This is the inverse of parse.

source

pub const fn name_by_op(opcode: u8) -> &'static str

Returns the opcode name.

source

pub const fn inputs(&self) -> u8

Returns the number of input stack elements.

source

pub const fn outputs(&self) -> u8

Returns the number of output stack elements.

source

pub const fn io_diff(&self) -> i16

Calculates the difference between the number of input and output stack elements.

source

pub const fn info_by_op(opcode: u8) -> Option<OpCodeInfo>

Returns the opcode information for the given opcode.

source

pub const fn info(&self) -> OpCodeInfo

Returns the opcode information.

source

pub const fn input_output(&self) -> (u8, u8)

Returns the number of both input and output stack elements.

Can be slightly faster that calling inputs and outputs separately.

source

pub const fn get(self) -> u8

Returns the opcode as a u8.

source

pub const fn modifies_memory(&self) -> bool

source§

impl OpCode

source

pub const STOP: Self = _

The 0x00 (“STOP”) opcode.

source

pub const ADD: Self = _

The 0x01 (“ADD”) opcode.

source

pub const MUL: Self = _

The 0x02 (“MUL”) opcode.

source

pub const SUB: Self = _

The 0x03 (“SUB”) opcode.

source

pub const DIV: Self = _

The 0x04 (“DIV”) opcode.

source

pub const SDIV: Self = _

The 0x05 (“SDIV”) opcode.

source

pub const MOD: Self = _

The 0x06 (“MOD”) opcode.

source

pub const SMOD: Self = _

The 0x07 (“SMOD”) opcode.

source

pub const ADDMOD: Self = _

The 0x08 (“ADDMOD”) opcode.

source

pub const MULMOD: Self = _

The 0x09 (“MULMOD”) opcode.

source

pub const EXP: Self = _

The 0x0A (“EXP”) opcode.

source

pub const SIGNEXTEND: Self = _

The 0x0B (“SIGNEXTEND”) opcode.

source

pub const LT: Self = _

The 0x10 (“LT”) opcode.

source

pub const GT: Self = _

The 0x11 (“GT”) opcode.

source

pub const SLT: Self = _

The 0x12 (“SLT”) opcode.

source

pub const SGT: Self = _

The 0x13 (“SGT”) opcode.

source

pub const EQ: Self = _

The 0x14 (“EQ”) opcode.

source

pub const ISZERO: Self = _

The 0x15 (“ISZERO”) opcode.

source

pub const AND: Self = _

The 0x16 (“AND”) opcode.

source

pub const OR: Self = _

The 0x17 (“OR”) opcode.

source

pub const XOR: Self = _

The 0x18 (“XOR”) opcode.

source

pub const NOT: Self = _

The 0x19 (“NOT”) opcode.

source

pub const BYTE: Self = _

The 0x1A (“BYTE”) opcode.

source

pub const SHL: Self = _

The 0x1B (“SHL”) opcode.

source

pub const SHR: Self = _

The 0x1C (“SHR”) opcode.

source

pub const SAR: Self = _

The 0x1D (“SAR”) opcode.

source

pub const KECCAK256: Self = _

The 0x20 (“KECCAK256”) opcode.

source

pub const ADDRESS: Self = _

The 0x30 (“ADDRESS”) opcode.

source

pub const BALANCE: Self = _

The 0x31 (“BALANCE”) opcode.

source

pub const ORIGIN: Self = _

The 0x32 (“ORIGIN”) opcode.

source

pub const CALLER: Self = _

The 0x33 (“CALLER”) opcode.

source

pub const CALLVALUE: Self = _

The 0x34 (“CALLVALUE”) opcode.

source

pub const CALLDATALOAD: Self = _

The 0x35 (“CALLDATALOAD”) opcode.

source

pub const CALLDATASIZE: Self = _

The 0x36 (“CALLDATASIZE”) opcode.

source

pub const CALLDATACOPY: Self = _

The 0x37 (“CALLDATACOPY”) opcode.

source

pub const CODESIZE: Self = _

The 0x38 (“CODESIZE”) opcode.

source

pub const CODECOPY: Self = _

The 0x39 (“CODECOPY”) opcode.

source

pub const GASPRICE: Self = _

The 0x3A (“GASPRICE”) opcode.

source

pub const EXTCODESIZE: Self = _

The 0x3B (“EXTCODESIZE”) opcode.

source

pub const EXTCODECOPY: Self = _

The 0x3C (“EXTCODECOPY”) opcode.

source

pub const RETURNDATASIZE: Self = _

The 0x3D (“RETURNDATASIZE”) opcode.

source

pub const RETURNDATACOPY: Self = _

The 0x3E (“RETURNDATACOPY”) opcode.

source

pub const EXTCODEHASH: Self = _

The 0x3F (“EXTCODEHASH”) opcode.

source

pub const BLOCKHASH: Self = _

The 0x40 (“BLOCKHASH”) opcode.

source

pub const COINBASE: Self = _

The 0x41 (“COINBASE”) opcode.

source

pub const TIMESTAMP: Self = _

The 0x42 (“TIMESTAMP”) opcode.

source

pub const NUMBER: Self = _

The 0x43 (“NUMBER”) opcode.

source

pub const DIFFICULTY: Self = _

The 0x44 (“DIFFICULTY”) opcode.

source

pub const GASLIMIT: Self = _

The 0x45 (“GASLIMIT”) opcode.

source

pub const CHAINID: Self = _

The 0x46 (“CHAINID”) opcode.

source

pub const SELFBALANCE: Self = _

The 0x47 (“SELFBALANCE”) opcode.

source

pub const BASEFEE: Self = _

The 0x48 (“BASEFEE”) opcode.

source

pub const BLOBHASH: Self = _

The 0x49 (“BLOBHASH”) opcode.

source

pub const BLOBBASEFEE: Self = _

The 0x4A (“BLOBBASEFEE”) opcode.

source

pub const POP: Self = _

The 0x50 (“POP”) opcode.

source

pub const MLOAD: Self = _

The 0x51 (“MLOAD”) opcode.

source

pub const MSTORE: Self = _

The 0x52 (“MSTORE”) opcode.

source

pub const MSTORE8: Self = _

The 0x53 (“MSTORE8”) opcode.

source

pub const SLOAD: Self = _

The 0x54 (“SLOAD”) opcode.

source

pub const SSTORE: Self = _

The 0x55 (“SSTORE”) opcode.

source

pub const JUMP: Self = _

The 0x56 (“JUMP”) opcode.

source

pub const JUMPI: Self = _

The 0x57 (“JUMPI”) opcode.

source

pub const PC: Self = _

The 0x58 (“PC”) opcode.

source

pub const MSIZE: Self = _

The 0x59 (“MSIZE”) opcode.

source

pub const GAS: Self = _

The 0x5A (“GAS”) opcode.

source

pub const JUMPDEST: Self = _

The 0x5B (“JUMPDEST”) opcode.

source

pub const TLOAD: Self = _

The 0x5C (“TLOAD”) opcode.

source

pub const TSTORE: Self = _

The 0x5D (“TSTORE”) opcode.

source

pub const MCOPY: Self = _

The 0x5E (“MCOPY”) opcode.

source

pub const PUSH0: Self = _

The 0x5F (“PUSH0”) opcode.

source

pub const PUSH1: Self = _

The 0x60 (“PUSH1”) opcode.

source

pub const PUSH2: Self = _

The 0x61 (“PUSH2”) opcode.

source

pub const PUSH3: Self = _

The 0x62 (“PUSH3”) opcode.

source

pub const PUSH4: Self = _

The 0x63 (“PUSH4”) opcode.

source

pub const PUSH5: Self = _

The 0x64 (“PUSH5”) opcode.

source

pub const PUSH6: Self = _

The 0x65 (“PUSH6”) opcode.

source

pub const PUSH7: Self = _

The 0x66 (“PUSH7”) opcode.

source

pub const PUSH8: Self = _

The 0x67 (“PUSH8”) opcode.

source

pub const PUSH9: Self = _

The 0x68 (“PUSH9”) opcode.

source

pub const PUSH10: Self = _

The 0x69 (“PUSH10”) opcode.

source

pub const PUSH11: Self = _

The 0x6A (“PUSH11”) opcode.

source

pub const PUSH12: Self = _

The 0x6B (“PUSH12”) opcode.

source

pub const PUSH13: Self = _

The 0x6C (“PUSH13”) opcode.

source

pub const PUSH14: Self = _

The 0x6D (“PUSH14”) opcode.

source

pub const PUSH15: Self = _

The 0x6E (“PUSH15”) opcode.

source

pub const PUSH16: Self = _

The 0x6F (“PUSH16”) opcode.

source

pub const PUSH17: Self = _

The 0x70 (“PUSH17”) opcode.

source

pub const PUSH18: Self = _

The 0x71 (“PUSH18”) opcode.

source

pub const PUSH19: Self = _

The 0x72 (“PUSH19”) opcode.

source

pub const PUSH20: Self = _

The 0x73 (“PUSH20”) opcode.

source

pub const PUSH21: Self = _

The 0x74 (“PUSH21”) opcode.

source

pub const PUSH22: Self = _

The 0x75 (“PUSH22”) opcode.

source

pub const PUSH23: Self = _

The 0x76 (“PUSH23”) opcode.

source

pub const PUSH24: Self = _

The 0x77 (“PUSH24”) opcode.

source

pub const PUSH25: Self = _

The 0x78 (“PUSH25”) opcode.

source

pub const PUSH26: Self = _

The 0x79 (“PUSH26”) opcode.

source

pub const PUSH27: Self = _

The 0x7A (“PUSH27”) opcode.

source

pub const PUSH28: Self = _

The 0x7B (“PUSH28”) opcode.

source

pub const PUSH29: Self = _

The 0x7C (“PUSH29”) opcode.

source

pub const PUSH30: Self = _

The 0x7D (“PUSH30”) opcode.

source

pub const PUSH31: Self = _

The 0x7E (“PUSH31”) opcode.

source

pub const PUSH32: Self = _

The 0x7F (“PUSH32”) opcode.

source

pub const DUP1: Self = _

The 0x80 (“DUP1”) opcode.

source

pub const DUP2: Self = _

The 0x81 (“DUP2”) opcode.

source

pub const DUP3: Self = _

The 0x82 (“DUP3”) opcode.

source

pub const DUP4: Self = _

The 0x83 (“DUP4”) opcode.

source

pub const DUP5: Self = _

The 0x84 (“DUP5”) opcode.

source

pub const DUP6: Self = _

The 0x85 (“DUP6”) opcode.

source

pub const DUP7: Self = _

The 0x86 (“DUP7”) opcode.

source

pub const DUP8: Self = _

The 0x87 (“DUP8”) opcode.

source

pub const DUP9: Self = _

The 0x88 (“DUP9”) opcode.

source

pub const DUP10: Self = _

The 0x89 (“DUP10”) opcode.

source

pub const DUP11: Self = _

The 0x8A (“DUP11”) opcode.

source

pub const DUP12: Self = _

The 0x8B (“DUP12”) opcode.

source

pub const DUP13: Self = _

The 0x8C (“DUP13”) opcode.

source

pub const DUP14: Self = _

The 0x8D (“DUP14”) opcode.

source

pub const DUP15: Self = _

The 0x8E (“DUP15”) opcode.

source

pub const DUP16: Self = _

The 0x8F (“DUP16”) opcode.

source

pub const SWAP1: Self = _

The 0x90 (“SWAP1”) opcode.

source

pub const SWAP2: Self = _

The 0x91 (“SWAP2”) opcode.

source

pub const SWAP3: Self = _

The 0x92 (“SWAP3”) opcode.

source

pub const SWAP4: Self = _

The 0x93 (“SWAP4”) opcode.

source

pub const SWAP5: Self = _

The 0x94 (“SWAP5”) opcode.

source

pub const SWAP6: Self = _

The 0x95 (“SWAP6”) opcode.

source

pub const SWAP7: Self = _

The 0x96 (“SWAP7”) opcode.

source

pub const SWAP8: Self = _

The 0x97 (“SWAP8”) opcode.

source

pub const SWAP9: Self = _

The 0x98 (“SWAP9”) opcode.

source

pub const SWAP10: Self = _

The 0x99 (“SWAP10”) opcode.

source

pub const SWAP11: Self = _

The 0x9A (“SWAP11”) opcode.

source

pub const SWAP12: Self = _

The 0x9B (“SWAP12”) opcode.

source

pub const SWAP13: Self = _

The 0x9C (“SWAP13”) opcode.

source

pub const SWAP14: Self = _

The 0x9D (“SWAP14”) opcode.

source

pub const SWAP15: Self = _

The 0x9E (“SWAP15”) opcode.

source

pub const SWAP16: Self = _

The 0x9F (“SWAP16”) opcode.

source

pub const LOG0: Self = _

The 0xA0 (“LOG0”) opcode.

source

pub const LOG1: Self = _

The 0xA1 (“LOG1”) opcode.

source

pub const LOG2: Self = _

The 0xA2 (“LOG2”) opcode.

source

pub const LOG3: Self = _

The 0xA3 (“LOG3”) opcode.

source

pub const LOG4: Self = _

The 0xA4 (“LOG4”) opcode.

source

pub const DATALOAD: Self = _

The 0xD0 (“DATALOAD”) opcode.

source

pub const DATALOADN: Self = _

The 0xD1 (“DATALOADN”) opcode.

source

pub const DATASIZE: Self = _

The 0xD2 (“DATASIZE”) opcode.

source

pub const DATACOPY: Self = _

The 0xD3 (“DATACOPY”) opcode.

source

pub const RJUMP: Self = _

The 0xE0 (“RJUMP”) opcode.

source

pub const RJUMPI: Self = _

The 0xE1 (“RJUMPI”) opcode.

source

pub const RJUMPV: Self = _

The 0xE2 (“RJUMPV”) opcode.

source

pub const CALLF: Self = _

The 0xE3 (“CALLF”) opcode.

source

pub const RETF: Self = _

The 0xE4 (“RETF”) opcode.

source

pub const JUMPF: Self = _

The 0xE5 (“JUMPF”) opcode.

source

pub const DUPN: Self = _

The 0xE6 (“DUPN”) opcode.

source

pub const SWAPN: Self = _

The 0xE7 (“SWAPN”) opcode.

source

pub const EXCHANGE: Self = _

The 0xE8 (“EXCHANGE”) opcode.

source

pub const EOFCREATE: Self = _

The 0xEC (“EOFCREATE”) opcode.

source

pub const RETURNCONTRACT: Self = _

The 0xEE (“RETURNCONTRACT”) opcode.

source

pub const CREATE: Self = _

The 0xF0 (“CREATE”) opcode.

source

pub const CALL: Self = _

The 0xF1 (“CALL”) opcode.

source

pub const CALLCODE: Self = _

The 0xF2 (“CALLCODE”) opcode.

source

pub const RETURN: Self = _

The 0xF3 (“RETURN”) opcode.

source

pub const DELEGATECALL: Self = _

The 0xF4 (“DELEGATECALL”) opcode.

source

pub const CREATE2: Self = _

The 0xF5 (“CREATE2”) opcode.

source

pub const RETURNDATALOAD: Self = _

The 0xF7 (“RETURNDATALOAD”) opcode.

source

pub const EXTCALL: Self = _

The 0xF8 (“EXTCALL”) opcode.

source

pub const EXTDELEGATECALL: Self = _

The 0xF9 (“EXTDELEGATECALL”) opcode.

source

pub const STATICCALL: Self = _

The 0xFA (“STATICCALL”) opcode.

source

pub const EXTSTATICCALL: Self = _

The 0xFB (“EXTSTATICCALL”) opcode.

source

pub const REVERT: Self = _

The 0xFD (“REVERT”) opcode.

source

pub const INVALID: Self = _

The 0xFE (“INVALID”) opcode.

source

pub const SELFDESTRUCT: Self = _

The 0xFF (“SELFDESTRUCT”) opcode.

Trait Implementations§

source§

impl Clone for OpCode

source§

fn clone(&self) -> OpCode

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 OpCode

source§

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

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

impl Default for OpCode

source§

fn default() -> OpCode

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

impl Display for OpCode

source§

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

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

impl FromStr for OpCode

§

type Err = OpCodeError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for OpCode

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 Ord for OpCode

source§

fn cmp(&self, other: &OpCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for OpCode

source§

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

source§

fn partial_cmp(&self, other: &OpCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for OpCode

source§

impl Eq for OpCode

source§

impl StructuralPartialEq for OpCode

Auto Trait Implementations§

§

impl Freeze for OpCode

§

impl RefUnwindSafe for OpCode

§

impl Send for OpCode

§

impl Sync for OpCode

§

impl Unpin for OpCode

§

impl UnwindSafe for OpCode

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
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

§

impl<T> Pipe for T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.