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: ExecutionConfigconfiguration
speculative_ledger: SpeculativeLedgerspeculative ledger state, as seen after everything that happened so far in the context
speculative_async_pool: SpeculativeAsyncPoolspeculative asynchronous pool state, as seen after everything that happened so far in the context
speculative_deferred_calls: SpeculativeDeferredCallRegistryspeculative deferred calls state,
speculative_roll_state: SpeculativeRollStatespeculative roll state, as seen after everything that happened so far in the context
speculative_executed_ops: SpeculativeExecutedOpsspeculative list of executed operations
speculative_executed_denunciations: SpeculativeExecutedDenunciationsspeculative list of executed denunciations
creator_min_balance: Option<Amount>minimal balance allowed for the creator of the operation after its execution
slot: Slotslot at which the execution happens
created_addr_index: u64counter of newly created addresses so far during this execution
created_event_index: u64counter of newly created events so far during this execution
created_message_index: u64counter 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: boolTrue if it’s a read-only context
events: EventStoregenerated events during this execution, with multiple indexes
unsafe_rng: Xoshiro256PlusPlusUnsafe 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: HashExecution trail hash
module_cache: Arc<RwLock<ModuleCache>>cache of compiled runtime modules
address_factory: AddressFactoryAddress 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: u32The version of the execution component
recursion_counter: u16recursion counter, incremented for each new nested call
user_event_count_in_current_exec: u16Counts 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
impl ExecutionContext
sourcepub(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
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
sourcepub(crate) fn get_snapshot(&self) -> ExecutionContextSnapshot
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.
sourcepub fn reset_to_snapshot(
&mut self,
snapshot: ExecutionContextSnapshot,
error: ExecutionError,
)
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 restorederror: an execution error to emit as an event conserved after snapshot reset.
sourcepub(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
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 happenreq: parameters of the read only executionfinal_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
pub(crate) fn take_async_batch( &mut self, max_gas: u64, async_msg_cst_gas_cost: u64, ) -> Vec<(AsyncMessageId, AsyncMessage)>
sourcepub(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
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 happenopt_block_id: optional ID of the block at that slotfinal_state: thread-safe access to the final state. Note that this will be used only for reading, never for writing
§returns
A ExecutionContext instance
sourcepub fn get_current_address(&self) -> Result<Address, ExecutionError>
pub fn get_current_address(&self) -> Result<Address, ExecutionError>
Gets the address at the top of the call stack, if any
sourcepub fn get_current_owned_addresses(
&self,
) -> Result<Vec<Address>, ExecutionError>
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
sourcepub fn get_current_call_coins(&self) -> Result<Amount, ExecutionError>
pub fn get_current_call_coins(&self) -> Result<Amount, ExecutionError>
Gets the current call coins
sourcepub fn get_call_stack(&self) -> Vec<Address>
pub fn get_call_stack(&self) -> Vec<Address>
Gets the addresses from the call stack (last = top of the stack)
sourcepub fn has_write_rights_on(&self, addr: &Address) -> bool
pub fn has_write_rights_on(&self, addr: &Address) -> bool
Checks whether the context currently grants write access to a given address
sourcepub fn create_new_sc_address(
&mut self,
bytecode: Bytecode,
) -> Result<Address, ExecutionError>
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
sourcepub fn get_bytecode(&self, address: &Address) -> Option<Bytecode>
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
sourcepub 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>
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
sourcepub fn get_data_entry(&self, address: &Address, key: &[u8]) -> Option<Vec<u8>>
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
sourcepub fn has_data_entry(&self, address: &Address, key: &[u8]) -> bool
pub fn has_data_entry(&self, address: &Address, key: &[u8]) -> bool
checks if a datastore entry exists in the speculative ledger
sourcepub fn get_balance(&self, address: &Address) -> Option<Amount>
pub fn get_balance(&self, address: &Address) -> Option<Amount>
gets the effective balance of an address
sourcepub fn set_data_entry(
&mut self,
address: &Address,
key: Vec<u8>,
data: Vec<u8>,
) -> Result<(), ExecutionError>
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
sourcepub fn append_data_entry(
&mut self,
address: &Address,
key: Vec<u8>,
data: Vec<u8>,
) -> Result<(), ExecutionError>
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
sourcepub fn delete_data_entry(
&mut self,
address: &Address,
key: &[u8],
) -> Result<(), ExecutionError>
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
sourcepub fn transfer_coins(
&mut self,
from_addr: Option<Address>,
to_addr: Option<Address>,
amount: Amount,
check_rights: bool,
transfer_context: TransferContext,
) -> Result<(), ExecutionError>
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 transfercheck_rights: check that the sender has the right to spend the coins according to the call stack
sourcepub fn push_new_message(&mut self, msg: AsyncMessage)
pub fn push_new_message(&mut self, msg: AsyncMessage)
sourcepub fn cancel_async_message(
&mut self,
msg: &AsyncMessage,
) -> Option<(Address, Result<Amount, String>)>
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
sourcepub fn add_rolls(
&mut self,
buyer_addr: &Address,
roll_count: u64,
operation_id: OperationId,
)
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 rollsroll_count: number of rolls it will receive
sourcepub fn try_sell_rolls(
&mut self,
seller_addr: &Address,
roll_count: u64,
operation_id: OperationId,
) -> Result<(), ExecutionError>
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 fromroll_count: number of rolls to sell
sourcepub fn try_slash_rolls(
&mut self,
denounced_addr: &Address,
roll_count: u64,
denunciation_idx: &DenunciationIndex,
) -> Result<Amount, ExecutionError>
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 fromroll_count: number of rolls to slash
sourcepub fn update_production_stats(
&mut self,
creator: &Address,
slot: Slot,
block_id: Option<BlockId>,
)
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 creatorslot: current slotblock_id: id of the block (if some)
sourcepub fn execute_deferred_credits(
&mut self,
slot: &Slot,
) -> Vec<(Address, Result<Amount, String>)>
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
sourcepub fn settle_slot(
&mut self,
block_info: Option<ExecutedBlockInfo>,
) -> ExecutionOutput
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.
sourcepub fn set_bytecode(
&mut self,
address: &Address,
bytecode: Bytecode,
) -> Result<(), ExecutionError>
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
sourcepub fn event_create(&self, data: String, is_error: bool) -> SCOutputEvent
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
sourcepub fn event_emit(&mut self, event: SCOutputEvent)
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.
sourcepub fn is_op_executed(&self, op_id: &OperationId) -> bool
pub fn is_op_executed(&self, op_id: &OperationId) -> bool
Check if an operation was previously executed (to prevent reuse)
sourcepub fn is_denunciation_executed(&self, de_idx: &DenunciationIndex) -> bool
pub fn is_denunciation_executed(&self, de_idx: &DenunciationIndex) -> bool
Check if a denunciation was previously executed (to prevent reuse)
sourcepub fn insert_executed_op(
&mut self,
op_id: OperationId,
op_exec_status: bool,
op_valid_until_slot: Slot,
)
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 IDop_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)
sourcepub fn insert_executed_denunciation(
&mut self,
denunciation_idx: &DenunciationIndex,
)
pub fn insert_executed_denunciation( &mut self, denunciation_idx: &DenunciationIndex, )
Insert a executed denunciation.
sourcepub fn get_address_cycle_infos(
&self,
address: &Address,
periods_per_cycle: u64,
) -> Vec<ExecutionAddressCycleInfo>
pub fn get_address_cycle_infos( &self, address: &Address, periods_per_cycle: u64, ) -> Vec<ExecutionAddressCycleInfo>
gets the cycle information for an address
sourcepub fn get_address_future_deferred_credits(
&self,
address: &Address,
thread_count: u8,
max_slot: Bound<Slot>,
) -> BTreeMap<Slot, Amount>
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)
sourcepub fn check_target_sc_address(
&self,
target_sc_address: Address,
) -> Result<(), ExecutionError>
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
pub fn deferred_calls_advance_slot( &mut self, current_slot: Slot, ) -> DeferredSlotCalls
sourcepub fn deferred_calls_compute_call_fee(
&self,
target_slot: Slot,
max_gas_request: u64,
current_slot: Slot,
params_size: u64,
) -> Result<Amount, ExecutionError>
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”.
pub fn deferred_call_register( &mut self, call: DeferredCall, ) -> Result<DeferredCallId, ExecutionError>
sourcepub fn deferred_call_exists(&self, call_id: &DeferredCallId) -> bool
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
sourcepub fn get_deferred_call(
&self,
call_id: &DeferredCallId,
) -> Option<DeferredCall>
pub fn get_deferred_call( &self, call_id: &DeferredCallId, ) -> Option<DeferredCall>
Get a deferred call by its id
sourcepub fn deferred_call_fail_exec(
&mut self,
id: &DeferredCallId,
call: &DeferredCall,
) -> Option<(Address, Result<Amount, String>)>
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
sourcepub fn deferred_call_cancel(
&mut self,
call_id: &DeferredCallId,
caller_address: Address,
) -> Result<(), ExecutionError>
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
sourcepub fn get_deferred_calls_by_slot(
&self,
slot: Slot,
) -> BTreeMap<DeferredCallId, DeferredCall>
pub fn get_deferred_calls_by_slot( &self, slot: Slot, ) -> BTreeMap<DeferredCallId, DeferredCall>
find the deferred calls for a given slot
sourcepub fn get_condom_limits(&self) -> CondomLimits
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§
impl Freeze for ExecutionContext
impl !RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl !UnwindSafe for ExecutionContext
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> FmtForward for T
impl<T> FmtForward for T
§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.§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.§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.§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.§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.§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.§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.§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.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§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 more§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 more§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
§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
§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.§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.§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.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§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 more§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 more§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 more§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 more§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 more§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 more§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.§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.§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.§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.§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.§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.§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.