Struct massa_execution_worker::context::ExecutionContext

source ·
pub struct ExecutionContext {
Show 29 fields config: ExecutionConfig, speculative_ledger: SpeculativeLedger, speculative_async_pool: SpeculativeAsyncPool, speculative_deferred_calls: SpeculativeDeferredCallRegistry, speculative_roll_state: SpeculativeRollState, speculative_executed_ops: SpeculativeExecutedOps, speculative_executed_denunciations: SpeculativeExecutedDenunciations, pub creator_min_balance: Option<Amount>, pub slot: Slot, pub created_addr_index: u64, pub created_event_index: u64, pub created_message_index: u64, pub opt_block_id: Option<BlockId>, pub stack: Vec<ExecutionStackElement>, pub read_only: bool, pub events: EventStore, pub unsafe_rng: Xoshiro256PlusPlus, pub creator_address: Option<Address>, pub origin_operation_id: Option<OperationId>, pub execution_trail_hash: Hash, pub module_cache: Arc<RwLock<ModuleCache>>, pub address_factory: AddressFactory, pub gas_remaining_before_subexecution: Option<u64>, pub execution_component_version: u32, pub recursion_counter: u16, pub user_event_count_in_current_exec: u16, transfers_history: Arc<RwLock<Vec<TransferInfo>>>, pub deferred_call_id: Option<DeferredCallId>, pub async_msg_id: Option<AsyncMessageId>,
}
Expand description

An execution context that needs to be initialized before executing bytecode, passed to the VM to interact with during bytecode execution (through ABIs), and read after execution to gather results.

Fields§

§config: ExecutionConfig

configuration

§speculative_ledger: SpeculativeLedger

speculative ledger state, as seen after everything that happened so far in the context

§speculative_async_pool: SpeculativeAsyncPool

speculative asynchronous pool state, as seen after everything that happened so far in the context

§speculative_deferred_calls: SpeculativeDeferredCallRegistry

speculative deferred calls state,

§speculative_roll_state: SpeculativeRollState

speculative roll state, as seen after everything that happened so far in the context

§speculative_executed_ops: SpeculativeExecutedOps

speculative list of executed operations

§speculative_executed_denunciations: SpeculativeExecutedDenunciations

speculative list of executed denunciations

§creator_min_balance: Option<Amount>

minimal balance allowed for the creator of the operation after its execution

§slot: Slot

slot at which the execution happens

§created_addr_index: u64

counter of newly created addresses so far during this execution

§created_event_index: u64

counter of newly created events so far during this execution

§created_message_index: u64

counter of newly created messages so far during this execution

§opt_block_id: Option<BlockId>

block Id, if one is present at the execution slot

§stack: Vec<ExecutionStackElement>

address call stack, most recent is at the back

§read_only: bool

True if it’s a read-only context

§events: EventStore

generated events during this execution, with multiple indexes

§unsafe_rng: Xoshiro256PlusPlus

Unsafe random state (can be predicted and manipulated)

§creator_address: Option<Address>

Creator address. The bytecode of this address can’t be modified

§origin_operation_id: Option<OperationId>

operation id that originally caused this execution (if any)

§execution_trail_hash: Hash

Execution trail hash

§module_cache: Arc<RwLock<ModuleCache>>

cache of compiled runtime modules

§address_factory: AddressFactory

Address factory

§gas_remaining_before_subexecution: Option<u64>

The gas remaining before the last subexecution. so excluding the gas used by the last sc call.

§execution_component_version: u32

The version of the execution component

§recursion_counter: u16

recursion counter, incremented for each new nested call

§user_event_count_in_current_exec: u16

Counts the number of event (apart from system events) in the current execution_context Should be reset to 0 when executing a new op / readonly request / asc / deferred call

§transfers_history: Arc<RwLock<Vec<TransferInfo>>>§deferred_call_id: Option<DeferredCallId>

The deferred call id that is currently being executed

§async_msg_id: Option<AsyncMessageId>

The async message id that is currently being executed

Implementations§

source§

impl ExecutionContext

source

pub(crate) fn new( config: ExecutionConfig, final_state: Arc<RwLock<dyn FinalStateController>>, active_history: Arc<RwLock<ActiveHistory>>, module_cache: Arc<RwLock<ModuleCache>>, mip_store: MipStore, execution_trail_hash: Hash, ) -> Self

Create a new empty ExecutionContext This should only be used as a placeholder. Further initialization is required before running bytecode (see read-only and active_slot methods).

§arguments
  • final_state: thread-safe access to the final state.

Note that this will be used only for reading, never for writing

§returns

A new (empty) ExecutionContext instance

source

pub(crate) fn get_snapshot(&self) -> ExecutionContextSnapshot

Returns a snapshot containing the clone of the current execution state. Note that the snapshot does not include slot-level information such as the slot number or block ID.

source

pub fn reset_to_snapshot( &mut self, snapshot: ExecutionContextSnapshot, error: ExecutionError, )

Resets context to an existing snapshot. Optionally emits an error as an event after restoring the snapshot. Note that the snapshot does not include slot-level information such as the slot number or block ID.

§Arguments
  • snapshot: a saved snapshot to be restored
  • error: an execution error to emit as an event conserved after snapshot reset.
source

pub(crate) fn readonly( config: ExecutionConfig, slot: Slot, call_stack: Vec<ExecutionStackElement>, final_state: Arc<RwLock<dyn FinalStateController>>, active_history: Arc<RwLock<ActiveHistory>>, module_cache: Arc<RwLock<ModuleCache>>, mip_store: MipStore, ) -> Self

Create a new ExecutionContext for read-only execution This should be used before performing a read-only execution.

§arguments
  • slot: slot at which the execution will happen
  • req: parameters of the read only execution
  • final_state: thread-safe access to the final state. Note that this will be used only for reading, never for writing
§returns

A ExecutionContext instance ready for a read-only execution

source

pub(crate) fn take_async_batch( &mut self, max_gas: u64, async_msg_cst_gas_cost: u64, ) -> Vec<(AsyncMessageId, AsyncMessage)>

source

pub(crate) fn active_slot( config: ExecutionConfig, slot: Slot, opt_block_id: Option<BlockId>, final_state: Arc<RwLock<dyn FinalStateController>>, active_history: Arc<RwLock<ActiveHistory>>, module_cache: Arc<RwLock<ModuleCache>>, mip_store: MipStore, ) -> Self

Create a new ExecutionContext for executing an active slot. This should be used before performing any executions at that slot.

§arguments
  • slot: slot at which the execution will happen
  • opt_block_id: optional ID of the block at that slot
  • final_state: thread-safe access to the final state. Note that this will be used only for reading, never for writing
§returns

A ExecutionContext instance

source

pub fn get_current_address(&self) -> Result<Address, ExecutionError>

Gets the address at the top of the call stack, if any

source

pub fn get_current_owned_addresses( &self, ) -> Result<Vec<Address>, ExecutionError>

Gets the current list of owned addresses (top of the stack) Ordering is conserved for determinism

source

pub fn get_current_call_coins(&self) -> Result<Amount, ExecutionError>

Gets the current call coins

source

pub fn get_call_stack(&self) -> Vec<Address>

Gets the addresses from the call stack (last = top of the stack)

source

pub fn has_write_rights_on(&self, addr: &Address) -> bool

Checks whether the context currently grants write access to a given address

source

pub fn create_new_sc_address( &mut self, bytecode: Bytecode, ) -> Result<Address, ExecutionError>

Creates a new smart contract address with initial bytecode, and returns this address

source

pub fn get_bytecode(&self, address: &Address) -> Option<Bytecode>

gets the bytecode of an address if it exists in the speculative ledger, or returns None

source

pub fn get_keys( &self, addr: &Address, prefix: &[u8], start_key: Bound<Vec<u8>>, end_key: Bound<Vec<u8>>, count: Option<u32>, ) -> Result<Option<BTreeSet<Vec<u8>>>, ExecutionError>

gets the datastore keys of an address if it exists in the speculative ledger, or returns None

source

pub fn get_data_entry(&self, address: &Address, key: &[u8]) -> Option<Vec<u8>>

gets the data from a datastore entry of an address if it exists in the speculative ledger, or returns None

source

pub fn has_data_entry(&self, address: &Address, key: &[u8]) -> bool

checks if a datastore entry exists in the speculative ledger

source

pub fn get_balance(&self, address: &Address) -> Option<Amount>

gets the effective balance of an address

source

pub fn set_data_entry( &mut self, address: &Address, key: Vec<u8>, data: Vec<u8>, ) -> Result<(), ExecutionError>

Sets a datastore entry for an address in the speculative ledger. Fail if the address is absent from the ledger. The datastore entry is created if it is absent for that address.

§Arguments
  • address: the address of the ledger entry
  • key: the datastore key
  • data: the data to insert
source

pub fn append_data_entry( &mut self, address: &Address, key: Vec<u8>, data: Vec<u8>, ) -> Result<(), ExecutionError>

Appends data to a datastore entry for an address in the speculative ledger. Fail if the address is absent from the ledger. Fails if the datastore entry is absent for that address.

§Arguments
  • address: the address of the ledger entry
  • key: the datastore key
  • data: the data to append
source

pub fn delete_data_entry( &mut self, address: &Address, key: &[u8], ) -> Result<(), ExecutionError>

Deletes a datastore entry for an address. Fails if the address or the entry does not exist or if write access rights are missing.

§Arguments
  • address: the address of the ledger entry
  • key: the datastore key
source

pub fn transfer_coins( &mut self, from_addr: Option<Address>, to_addr: Option<Address>, amount: Amount, check_rights: bool, transfer_context: TransferContext, ) -> Result<(), ExecutionError>

Transfers coins from one address to another. No changes are retained in case of failure. Spending is only allowed from existing addresses we have write access on

§Arguments
  • from_addr: optional spending address (use None for pure coin creation)
  • to_addr: optional crediting address (use None for pure coin destruction)
  • amount: amount of coins to transfer
  • check_rights: check that the sender has the right to spend the coins according to the call stack
source

pub fn push_new_message(&mut self, msg: AsyncMessage)

Add a new asynchronous message to speculative pool

§Arguments
  • msg: asynchronous message to add
source

pub fn cancel_async_message( &mut self, msg: &AsyncMessage, ) -> Option<(Address, Result<Amount, String>)>

Cancels an asynchronous message, reimbursing msg.coins to the sender

§Arguments
  • msg: the asynchronous message to cancel
source

pub fn add_rolls( &mut self, buyer_addr: &Address, roll_count: u64, operation_id: OperationId, )

Add roll_count rolls to the buyer address. Validity checks must be performed outside of this function.

§Arguments
  • buyer_addr: address that will receive the rolls
  • roll_count: number of rolls it will receive
source

pub fn try_sell_rolls( &mut self, seller_addr: &Address, roll_count: u64, operation_id: OperationId, ) -> Result<(), ExecutionError>

Try to sell roll_count rolls from the seller address.

§Arguments
  • seller_addr: address to sell the rolls from
  • roll_count: number of rolls to sell
source

pub fn try_slash_rolls( &mut self, denounced_addr: &Address, roll_count: u64, denunciation_idx: &DenunciationIndex, ) -> Result<Amount, ExecutionError>

Try to slash roll_count rolls from the denounced address. If not enough rolls, slash the available amount and return the result

§Arguments
  • denounced_addr: address to sell the rolls from
  • roll_count: number of rolls to slash
source

pub fn update_production_stats( &mut self, creator: &Address, slot: Slot, block_id: Option<BlockId>, )

Update production statistics of an address.

§Arguments
  • creator: the supposed creator
  • slot: current slot
  • block_id: id of the block (if some)
source

pub fn execute_deferred_credits( &mut self, slot: &Slot, ) -> Vec<(Address, Result<Amount, String>)>

Execute the deferred credits of slot.

§Arguments
  • slot: associated slot of the deferred credits to be executed
source

pub fn settle_slot( &mut self, block_info: Option<ExecutedBlockInfo>, ) -> ExecutionOutput

Finishes a slot and generates the execution output. Settles emitted asynchronous messages, reimburse the senders of deleted messages. Moves the output of the execution out of the context, resetting some context fields in the process.

This is used to get the output of an execution before discarding the context. Note that we are not taking self by value to consume it because the context is shared.

source

pub fn set_bytecode( &mut self, address: &Address, bytecode: Bytecode, ) -> Result<(), ExecutionError>

Sets a bytecode for an address in the speculative ledger. Fail if the address is absent from the ledger.

§Arguments
  • address: the address of the ledger entry
  • data: the bytecode to set
source

pub fn event_create(&self, data: String, is_error: bool) -> SCOutputEvent

Creates a new event but does not emit it. Note that this does not increment the context event counter.

§Arguments:

data: the string data that is the payload of the event

source

pub fn event_emit(&mut self, event: SCOutputEvent)

Emits a previously created event. Overrides the event’s index with the current event counter value, and increments the event counter.

source

pub fn is_op_executed(&self, op_id: &OperationId) -> bool

Check if an operation was previously executed (to prevent reuse)

source

pub fn is_denunciation_executed(&self, de_idx: &DenunciationIndex) -> bool

Check if a denunciation was previously executed (to prevent reuse)

source

pub fn insert_executed_op( &mut self, op_id: OperationId, op_exec_status: bool, op_valid_until_slot: Slot, )

Insert an executed operation. Does not check for reuse, please use is_op_executed before.

§Arguments
  • op_id: operation ID
  • op_exec_status : the status of the execution of the operation (true: success, false: failed).
  • op_valid_until_slot: slot until which the operation remains valid (included)
source

pub fn insert_executed_denunciation( &mut self, denunciation_idx: &DenunciationIndex, )

Insert a executed denunciation.

source

pub fn get_address_cycle_infos( &self, address: &Address, periods_per_cycle: u64, ) -> Vec<ExecutionAddressCycleInfo>

gets the cycle information for an address

source

pub fn get_address_future_deferred_credits( &self, address: &Address, thread_count: u8, max_slot: Bound<Slot>, ) -> BTreeMap<Slot, Amount>

Get future deferred credits of an address With optionally a limit slot (excluded)

source

pub fn check_target_sc_address( &self, target_sc_address: Address, ) -> Result<(), ExecutionError>

in case of

async_msg, call OP, call SC to SC, read only call

check if the given address is a smart contract address and if it exists returns an error instead

source

pub fn deferred_calls_advance_slot( &mut self, current_slot: Slot, ) -> DeferredSlotCalls

source

pub fn deferred_calls_compute_call_fee( &self, target_slot: Slot, max_gas_request: u64, current_slot: Slot, params_size: u64, ) -> Result<Amount, ExecutionError>

Get the price it would cost to reserve “gas” with params at target slot “slot”.

source

pub fn deferred_call_register( &mut self, call: DeferredCall, ) -> Result<DeferredCallId, ExecutionError>

source

pub fn deferred_call_exists(&self, call_id: &DeferredCallId) -> bool

Check if a deferred call exists If it exists, check if it has been cancelled If it has been cancelled, return false

source

pub fn get_deferred_call( &self, call_id: &DeferredCallId, ) -> Option<DeferredCall>

Get a deferred call by its id

source

pub fn deferred_call_fail_exec( &mut self, id: &DeferredCallId, call: &DeferredCall, ) -> Option<(Address, Result<Amount, String>)>

when a deferred call execution fails we need to refund the coins to the caller

source

pub fn deferred_call_cancel( &mut self, call_id: &DeferredCallId, caller_address: Address, ) -> Result<(), ExecutionError>

when a deferred call is cancelled we need to refund the coins to the caller

source

pub fn get_deferred_calls_by_slot( &self, slot: Slot, ) -> BTreeMap<DeferredCallId, DeferredCall>

find the deferred calls for a given slot

source

pub fn get_condom_limits(&self) -> CondomLimits

Get the condom limits to pass to the VM depending on the current execution component version

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
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
§

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.

§

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

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

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

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

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

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

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
§

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

§

fn vzip(self) -> V

§

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
§

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

§

impl<T> MaybeSendSync for T