Struct fuel_vm::interpreter::Interpreter
source · pub struct Interpreter<M, S, Tx = (), Ecal = NotSupportedEcal> { /* private fields */ }
Expand description
VM interpreter.
The internal state of the VM isn’t expose because the intended usage is to either inspect the resulting receipts after a transaction execution, or the resulting mutated transaction.
These can be obtained with the help of a crate::transactor::Transactor
or a client implementation.
Implementations§
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn with_storage(
memory: M,
storage: S,
interpreter_params: InterpreterParams,
) -> Self
pub fn with_storage( memory: M, storage: S, interpreter_params: InterpreterParams, ) -> Self
Create a new interpreter instance out of a storage implementation.
If the provided storage implements
crate::storage::InterpreterStorage
, the returned interpreter
will provide full functionality.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
Tx: Default,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
Tx: Default,
sourcepub fn with_storage_and_ecal(
memory: M,
storage: S,
interpreter_params: InterpreterParams,
ecal_state: Ecal,
) -> Self
pub fn with_storage_and_ecal( memory: M, storage: S, interpreter_params: InterpreterParams, ecal_state: Ecal, ) -> Self
Create a new interpreter instance out of a storage implementation.
If the provided storage implements
crate::storage::InterpreterStorage
, the returned interpreter
will provide full functionality.
source§impl<M, S, Tx, Ecal> Interpreter<M, Record<S>, Tx, Ecal>where
S: InterpreterStorage,
Tx: ExecutableTransaction,
impl<M, S, Tx, Ecal> Interpreter<M, Record<S>, Tx, Ecal>where
S: InterpreterStorage,
Tx: ExecutableTransaction,
sourcepub fn remove_recording(self) -> Interpreter<M, S, Tx, Ecal>
pub fn remove_recording(self) -> Interpreter<M, S, Tx, Ecal>
Remove the [Recording
] wrapper from the storage.
Recording storage changes has an overhead so it’s
useful to be able to remove it once the diff is generated.
sourcepub fn storage_diff(&self) -> Diff<Deltas>
pub fn storage_diff(&self) -> Diff<Deltas>
Get the diff of changes to this VMs storage.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn add_recording(self) -> Interpreter<M, Record<S>, Tx, Ecal>
pub fn add_recording(self) -> Interpreter<M, Record<S>, Tx, Ecal>
Add a [Recording
] wrapper around the storage to
record any changes this VM makes to it’s storage.
Recording storage changes has an overhead so should
be used in production.
sourcepub fn reset_vm_state(&mut self, diff: &Diff<InitialVmState>)where
Tx: Clone + 'static,
pub fn reset_vm_state(&mut self, diff: &Diff<InitialVmState>)where
Tx: Clone + 'static,
Change this VMs internal state to match the initial state from this diff.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn execute(
&mut self,
) -> Result<ExecuteState, InterpreterError<S::DataError>>
pub fn execute( &mut self, ) -> Result<ExecuteState, InterpreterError<S::DataError>>
Execute the current instruction located in $m[$pc]
.
sourcepub fn instruction<R: Into<RawInstruction> + Copy>(
&mut self,
raw: R,
) -> Result<ExecuteState, InterpreterError<S::DataError>>
pub fn instruction<R: Into<RawInstruction> + Copy>( &mut self, raw: R, ) -> Result<ExecuteState, InterpreterError<S::DataError>>
Execute a provided instruction
source§impl<Tx> Interpreter<&mut MemoryInstance, PredicateStorage, Tx>where
Tx: ExecutableTransaction,
impl<Tx> Interpreter<&mut MemoryInstance, PredicateStorage, Tx>where
Tx: ExecutableTransaction,
sourcepub fn check_predicates(
checked: &Checked<Tx>,
params: &CheckPredicateParams,
memory: impl Memory,
) -> Result<PredicatesChecked, PredicateVerificationFailed>
pub fn check_predicates( checked: &Checked<Tx>, params: &CheckPredicateParams, memory: impl Memory, ) -> Result<PredicatesChecked, PredicateVerificationFailed>
Initialize the VM with the provided transaction and check all predicates defined in the inputs.
The storage provider is not used since contract opcodes are not allowed for predicates.
sourcepub async fn check_predicates_async<E>(
checked: &Checked<Tx>,
params: &CheckPredicateParams,
pool: &impl VmMemoryPool,
) -> Result<PredicatesChecked, PredicateVerificationFailed>
pub async fn check_predicates_async<E>( checked: &Checked<Tx>, params: &CheckPredicateParams, pool: &impl VmMemoryPool, ) -> Result<PredicatesChecked, PredicateVerificationFailed>
Initialize the VM with the provided transaction and check all predicates defined in the inputs in parallel.
The storage provider is not used since contract opcodes are not allowed for predicates.
sourcepub fn estimate_predicates(
transaction: &mut Tx,
params: &CheckPredicateParams,
memory: impl Memory,
) -> Result<PredicatesChecked, PredicateVerificationFailed>
pub fn estimate_predicates( transaction: &mut Tx, params: &CheckPredicateParams, memory: impl Memory, ) -> Result<PredicatesChecked, PredicateVerificationFailed>
Initialize the VM with the provided transaction, check all predicates defined in the inputs and set the predicate_gas_used to be the actual gas consumed during execution for each predicate.
The storage provider is not used since contract opcodes are not allowed for predicates.
sourcepub async fn estimate_predicates_async<E>(
transaction: &mut Tx,
params: &CheckPredicateParams,
pool: &impl VmMemoryPool,
) -> Result<PredicatesChecked, PredicateVerificationFailed>where
Tx: Send + 'static,
E: ParallelExecutor,
pub async fn estimate_predicates_async<E>(
transaction: &mut Tx,
params: &CheckPredicateParams,
pool: &impl VmMemoryPool,
) -> Result<PredicatesChecked, PredicateVerificationFailed>where
Tx: Send + 'static,
E: ParallelExecutor,
Initialize the VM with the provided transaction, check all predicates defined in the inputs and set the predicate_gas_used to be the actual gas consumed during execution for each predicate in parallel.
The storage provider is not used since contract opcodes are not allowed for predicates.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
S: InterpreterStorage,
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
Ecal: EcalHandler,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
S: InterpreterStorage,
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
Ecal: EcalHandler,
sourcepub fn transact(
&mut self,
tx: Ready<Tx>,
) -> Result<StateTransitionRef<'_, Tx>, InterpreterError<S::DataError>>
pub fn transact( &mut self, tx: Ready<Tx>, ) -> Result<StateTransitionRef<'_, Tx>, InterpreterError<S::DataError>>
Initialize a pre-allocated instance of Interpreter
with the provided
transaction and execute it. The result will be bound to the lifetime
of the interpreter and will avoid unnecessary copy with the data
that can be referenced from the interpreter instance itself.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
S: InterpreterStorage,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
S: InterpreterStorage,
sourcepub fn deploy(
&mut self,
tx: Ready<Create>,
) -> Result<Create, InterpreterError<S::DataError>>
pub fn deploy( &mut self, tx: Ready<Create>, ) -> Result<Create, InterpreterError<S::DataError>>
Deploys Create
transaction without initialization VM and without invalidation of
the last state of execution of the Script
transaction.
Returns Create
transaction with all modifications after execution.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
S: InterpreterStorage,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
S: InterpreterStorage,
sourcepub fn upgrade(
&mut self,
tx: Ready<Upgrade>,
) -> Result<Upgrade, InterpreterError<S::DataError>>
pub fn upgrade( &mut self, tx: Ready<Upgrade>, ) -> Result<Upgrade, InterpreterError<S::DataError>>
Executes Upgrade
transaction without initialization VM and without invalidation
of the last state of execution of the Script
transaction.
Returns Upgrade
transaction with all modifications after execution.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
S: InterpreterStorage,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
S: InterpreterStorage,
sourcepub fn upload(
&mut self,
tx: Ready<Upload>,
) -> Result<Upload, InterpreterError<S::DataError>>
pub fn upload( &mut self, tx: Ready<Upload>, ) -> Result<Upload, InterpreterError<S::DataError>>
Executes Upload
transaction without initialization VM and without invalidation
of the last state of execution of the Script
transaction.
Returns Upload
transaction with all modifications after execution.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn resume(&mut self) -> Result<ProgramState, InterpreterError<S::DataError>>
pub fn resume(&mut self) -> Result<ProgramState, InterpreterError<S::DataError>>
Continue the execution from a previously interrupted program flow.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn remaining_gas(&self) -> Word
pub fn remaining_gas(&self) -> Word
Global remaining gas amount
sourcepub fn gas_charge(&mut self, gas: Word) -> SimpleResult<()>
pub fn gas_charge(&mut self, gas: Word) -> SimpleResult<()>
Do a gas charge with the given amount, panicing when running out of gas.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn init_predicate(
&mut self,
context: Context,
tx: Tx,
gas_limit: Word,
) -> Result<(), InterpreterError<S::DataError>>
pub fn init_predicate( &mut self, context: Context, tx: Tx, gas_limit: Word, ) -> Result<(), InterpreterError<S::DataError>>
Initialize the VM for a predicate context
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
S: InterpreterStorage,
<S as InterpreterStorage>::DataError: From<S::DataError>,
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
S: InterpreterStorage,
<S as InterpreterStorage>::DataError: From<S::DataError>,
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
sourcepub fn init_script(
&mut self,
ready_tx: Ready<Tx>,
) -> Result<(), InterpreterError<S::DataError>>
pub fn init_script( &mut self, ready_tx: Ready<Tx>, ) -> Result<(), InterpreterError<S::DataError>>
Initialize the VM with a given transaction, backed by a storage provider that allows execution of contract opcodes.
For predicate estimation and verification, check Self::init_predicate
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
M: Memory,
sourcepub fn allocate(&mut self, amount: Word) -> SimpleResult<()>
pub fn allocate(&mut self, amount: Word) -> SimpleResult<()>
Expand heap by amount
bytes.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
Tx: ExecutableTransaction,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
Tx: ExecutableTransaction,
sourcepub const fn single_stepping(&self) -> bool
pub const fn single_stepping(&self) -> bool
Get single-stepping mode
sourcepub fn set_single_stepping(&mut self, single_stepping: bool)
pub fn set_single_stepping(&mut self, single_stepping: bool)
Set single-stepping mode
sourcepub fn clear_breakpoints(&mut self)
pub fn clear_breakpoints(&mut self)
Clear all set breakpoints.
sourcepub fn set_breakpoint(&mut self, breakpoint: Breakpoint)
pub fn set_breakpoint(&mut self, breakpoint: Breakpoint)
Set a new breakpoint for the provided location.
sourcepub fn overwrite_breakpoints(&mut self, breakpoints: &[Breakpoint])
pub fn overwrite_breakpoints(&mut self, breakpoints: &[Breakpoint])
Overwrite all breakpoints with a new set of breakpoints.
sourcepub fn remove_breakpoint(&mut self, breakpoint: &Breakpoint)
pub fn remove_breakpoint(&mut self, breakpoint: &Breakpoint)
Remove a previously set breakpoint.
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
Ecal: EcalHandler,
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>where
Ecal: EcalHandler,
sourcepub fn ecal_state(&self) -> &Ecal
pub fn ecal_state(&self) -> &Ecal
Read access to the ECAL state
sourcepub fn ecal_state_mut(&mut self) -> &mut Ecal
pub fn ecal_state_mut(&mut self) -> &mut Ecal
Write access to the ECAL state
source§impl<M: Memory, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M: Memory, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn memory(&self) -> &MemoryInstance
pub fn memory(&self) -> &MemoryInstance
Returns the current state of the VM memory
source§impl<M: AsMut<MemoryInstance>, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M: AsMut<MemoryInstance>, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn memory_mut(&mut self) -> &mut MemoryInstance
pub fn memory_mut(&mut self) -> &mut MemoryInstance
Returns mutable access to the vm memory
source§impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Interpreter<M, S, Tx, Ecal>
sourcepub fn registers_mut(&mut self) -> &mut [Word]
pub fn registers_mut(&mut self) -> &mut [Word]
Returns mutable access to the registers
sourcepub fn transaction(&self) -> &Tx
pub fn transaction(&self) -> &Tx
The current transaction.
sourcepub fn initial_balances(&self) -> &InitialBalances
pub fn initial_balances(&self) -> &InitialBalances
The initial balances.
sourcepub fn max_inputs(&self) -> u16
pub fn max_inputs(&self) -> u16
Get max_inputs value
sourcepub fn fee_params(&self) -> &FeeParameters
pub fn fee_params(&self) -> &FeeParameters
Get the Fee Parameters
sourcepub fn base_asset_id(&self) -> &AssetId
pub fn base_asset_id(&self) -> &AssetId
Get the base Asset ID
sourcepub fn contract_max_size(&self) -> u64
pub fn contract_max_size(&self) -> u64
Get contract_max_size value
sourcepub fn max_message_data_length(&self) -> u64
pub fn max_message_data_length(&self) -> u64
Get max_message_data_length value
sourcepub fn compute_receipts_root(&self) -> Bytes32
pub fn compute_receipts_root(&self) -> Bytes32
Compute current receipts root
Trait Implementations§
source§impl<M, S, Tx, Ecal> AsMut<S> for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> AsMut<S> for Interpreter<M, S, Tx, Ecal>
source§impl<M, S, Tx, Ecal> AsRef<Interpreter<M, S, Tx, Ecal>> for Transactor<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> AsRef<Interpreter<M, S, Tx, Ecal>> for Transactor<M, S, Tx, Ecal>
source§fn as_ref(&self) -> &Interpreter<M, S, Tx, Ecal>
fn as_ref(&self) -> &Interpreter<M, S, Tx, Ecal>
source§impl<M, S, Tx, Ecal> AsRef<S> for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> AsRef<S> for Interpreter<M, S, Tx, Ecal>
source§impl<M: Clone, S: Clone, Tx: Clone, Ecal: Clone> Clone for Interpreter<M, S, Tx, Ecal>
impl<M: Clone, S: Clone, Tx: Clone, Ecal: Clone> Clone for Interpreter<M, S, Tx, Ecal>
source§fn clone(&self) -> Interpreter<M, S, Tx, Ecal>
fn clone(&self) -> Interpreter<M, S, Tx, Ecal>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<M, S, Tx, Ecal> From<Interpreter<M, S, Tx, Ecal>> for Transactor<M, S, Tx, Ecal>where
Tx: ExecutableTransaction,
S: InterpreterStorage,
impl<M, S, Tx, Ecal> From<Interpreter<M, S, Tx, Ecal>> for Transactor<M, S, Tx, Ecal>where
Tx: ExecutableTransaction,
S: InterpreterStorage,
source§fn from(interpreter: Interpreter<M, S, Tx, Ecal>) -> Self
fn from(interpreter: Interpreter<M, S, Tx, Ecal>) -> Self
source§impl<M, S, Tx, Ecal> From<Transactor<M, S, Tx, Ecal>> for Interpreter<M, S, Tx, Ecal>where
Tx: ExecutableTransaction,
S: InterpreterStorage,
impl<M, S, Tx, Ecal> From<Transactor<M, S, Tx, Ecal>> for Interpreter<M, S, Tx, Ecal>where
Tx: ExecutableTransaction,
S: InterpreterStorage,
source§fn from(transactor: Transactor<M, S, Tx, Ecal>) -> Self
fn from(transactor: Transactor<M, S, Tx, Ecal>) -> Self
source§impl<M, S, Tx, Ecal> PartialEq for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> PartialEq for Interpreter<M, S, Tx, Ecal>
Auto Trait Implementations§
impl<M, S, Tx, Ecal> Freeze for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> RefUnwindSafe for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Send for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Sync for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> Unpin for Interpreter<M, S, Tx, Ecal>
impl<M, S, Tx, Ecal> UnwindSafe for Interpreter<M, S, Tx, Ecal>
Blanket Implementations§
source§impl<T> AnyDebug for T
impl<T> AnyDebug for T
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> StorageAsMut for T
impl<T> StorageAsMut for T
fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
source§impl<T> StorageAsRef for T
impl<T> StorageAsRef for T
fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.