pub struct WasmTestBuilder<S> { /* private fields */ }
Expand description
Builder for simple WASM test
Implementations
sourceimpl WasmTestBuilder<InMemoryGlobalState>
impl WasmTestBuilder<InMemoryGlobalState>
sourcepub fn new(
global_state: InMemoryGlobalState,
engine_config: EngineConfig,
maybe_post_state_hash: Option<Digest>
) -> Self
pub fn new(
global_state: InMemoryGlobalState,
engine_config: EngineConfig,
maybe_post_state_hash: Option<Digest>
) -> Self
Returns an InMemoryWasmTestBuilder
.
sourceimpl WasmTestBuilder<LmdbGlobalState>
impl WasmTestBuilder<LmdbGlobalState>
sourcepub fn new_with_config<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig
) -> Self
pub fn new_with_config<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig
) -> Self
Returns an LmdbWasmTestBuilder
with configuration.
sourcepub fn flush_environment(&self)
pub fn flush_environment(&self)
Flushes the LMDB environment to disk.
sourcepub fn open<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
pub fn open<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
Creates a new instance of builder using the supplied configurations, opening wrapped LMDBs (e.g. in the Trie and Data stores) rather than creating them.
sourcepub fn open_raw<T: AsRef<Path>>(
global_state_dir: T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
pub fn open_raw<T: AsRef<Path>>(
global_state_dir: T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
Creates a new instance of builder using the supplied configurations, opening wrapped LMDBs
(e.g. in the Trie and Data stores) rather than creating them.
Differs from open
in that it doesn’t append GLOBAL_STATE_DIR
to the supplied path.
sourceimpl<S> WasmTestBuilder<S> where
S: StateProvider,
Error: From<S::Error>,
S::Error: Into<Error>,
impl<S> WasmTestBuilder<S> where
S: StateProvider,
Error: From<S::Error>,
S::Error: Into<Error>,
sourcepub fn run_genesis(
&mut self,
run_genesis_request: &RunGenesisRequest
) -> &mut Self
pub fn run_genesis(
&mut self,
run_genesis_request: &RunGenesisRequest
) -> &mut Self
Takes a RunGenesisRequest
, executes the request and returns Self.
sourcepub fn query(
&self,
maybe_post_state: Option<Digest>,
base_key: Key,
path: &[String]
) -> Result<StoredValue, String>
pub fn query(
&self,
maybe_post_state: Option<Digest>,
base_key: Key,
path: &[String]
) -> Result<StoredValue, String>
Queries state for a StoredValue
.
sourcepub fn query_dictionary_item(
&self,
maybe_post_state: Option<Digest>,
dictionary_seed_uref: URef,
dictionary_item_key: &str
) -> Result<StoredValue, String>
pub fn query_dictionary_item(
&self,
maybe_post_state: Option<Digest>,
dictionary_seed_uref: URef,
dictionary_item_key: &str
) -> Result<StoredValue, String>
Queries state for a dictionary item.
sourcepub fn query_with_proof(
&self,
maybe_post_state: Option<Digest>,
base_key: Key,
path: &[String]
) -> Result<(StoredValue, Vec<TrieMerkleProof<Key, StoredValue>>), String>
pub fn query_with_proof(
&self,
maybe_post_state: Option<Digest>,
base_key: Key,
path: &[String]
) -> Result<(StoredValue, Vec<TrieMerkleProof<Key, StoredValue>>), String>
Queries for a StoredValue
and returns the StoredValue
and a Merkle proof.
sourcepub fn total_supply(&self, maybe_post_state: Option<Digest>) -> U512
pub fn total_supply(&self, maybe_post_state: Option<Digest>) -> U512
sourcepub fn exec(&mut self, exec_request: ExecuteRequest) -> &mut Self
pub fn exec(&mut self, exec_request: ExecuteRequest) -> &mut Self
Runs an ExecuteRequest
.
sourcepub fn commit(&mut self) -> &mut Self
pub fn commit(&mut self) -> &mut Self
Commit effects of previous exec call on the latest post-state hash.
sourcepub fn commit_transforms(
&mut self,
pre_state_hash: Digest,
effects: AdditiveMap<Key, Transform>
) -> &mut Self
pub fn commit_transforms(
&mut self,
pre_state_hash: Digest,
effects: AdditiveMap<Key, Transform>
) -> &mut Self
Runs a commit request, expects a successful response, and overwrites existing cached post state hash with a new one.
sourcepub fn upgrade_with_upgrade_request(
&mut self,
engine_config: EngineConfig,
upgrade_config: &mut UpgradeConfig
) -> &mut Self
pub fn upgrade_with_upgrade_request(
&mut self,
engine_config: EngineConfig,
upgrade_config: &mut UpgradeConfig
) -> &mut Self
Upgrades the execution engine.
sourcepub fn run_auction(
&mut self,
era_end_timestamp_millis: u64,
evicted_validators: Vec<PublicKey>
) -> &mut Self
pub fn run_auction(
&mut self,
era_end_timestamp_millis: u64,
evicted_validators: Vec<PublicKey>
) -> &mut Self
Executes a request to call the system auction contract.
sourcepub fn step(
&mut self,
step_request: StepRequest
) -> Result<StepSuccess, StepError>
pub fn step(
&mut self,
step_request: StepRequest
) -> Result<StepSuccess, StepError>
Increments engine state.
sourcepub fn expect_success(&mut self) -> &mut Self
pub fn expect_success(&mut self) -> &mut Self
Expects a successful run
sourcepub fn expect_failure(&mut self) -> &mut Self
pub fn expect_failure(&mut self) -> &mut Self
Expects a failed run
sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Returns true
if the las exec had an error, otherwise returns false.
sourcepub fn get_error(&self) -> Option<Error>
pub fn get_error(&self) -> Option<Error>
Returns an Option<engine_state::Error>
if the last exec had an error.
sourcepub fn get_transforms(&self) -> Vec<AdditiveMap<Key, Transform>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_transforms(&self) -> Vec<AdditiveMap<Key, Transform>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Gets the transform map that’s cached between runs
sourcepub fn get_genesis_account(&self) -> &Account
pub fn get_genesis_account(&self) -> &Account
Gets genesis account (if present)
sourcepub fn get_mint_contract_hash(&self) -> ContractHash
pub fn get_mint_contract_hash(&self) -> ContractHash
Returns the ContractHash
of the mint, panics if it can’t be found.
sourcepub fn get_handle_payment_contract_hash(&self) -> ContractHash
pub fn get_handle_payment_contract_hash(&self) -> ContractHash
Returns the ContractHash
of the “handle payment” contract, panics if it can’t be found.
sourcepub fn get_standard_payment_contract_hash(&self) -> ContractHash
pub fn get_standard_payment_contract_hash(&self) -> ContractHash
Returns the ContractHash
of the “standard payment” contract, panics if it can’t be
found.
sourcepub fn get_auction_contract_hash(&self) -> ContractHash
pub fn get_auction_contract_hash(&self) -> ContractHash
Returns the ContractHash
of the “auction” contract, panics if it can’t be found.
sourcepub fn get_genesis_transforms(&self) -> &AdditiveMap<Key, Transform>
pub fn get_genesis_transforms(&self) -> &AdditiveMap<Key, Transform>
Returns genesis transforms, panics if there aren’t any.
sourcepub fn get_genesis_hash(&self) -> Digest
pub fn get_genesis_hash(&self) -> Digest
Returns the genesis hash, panics if it can’t be found.
sourcepub fn get_post_state_hash(&self) -> Digest
pub fn get_post_state_hash(&self) -> Digest
Returns the post state hash, panics if it can’t be found.
sourcepub fn get_engine_state(&self) -> &EngineState<S>
pub fn get_engine_state(&self) -> &EngineState<S>
Returns the engine state.
sourcepub fn get_exec_results(&self) -> &Vec<Vec<Rc<ExecutionResult>>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_exec_results(&self) -> &Vec<Vec<Rc<ExecutionResult>>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the results of all execs.
sourcepub fn get_exec_result(&self, index: usize) -> Option<&Vec<Rc<ExecutionResult>>>
pub fn get_exec_result(&self, index: usize) -> Option<&Vec<Rc<ExecutionResult>>>
Returns the results of a specific exec.
sourcepub fn get_exec_results_count(&self) -> usize
pub fn get_exec_results_count(&self) -> usize
Returns a count of exec results.
sourcepub fn get_upgrade_result(
&self,
index: usize
) -> Option<&Result<UpgradeSuccess, Error>>
pub fn get_upgrade_result(
&self,
index: usize
) -> Option<&Result<UpgradeSuccess, Error>>
Returns a Result
containing an UpgradeSuccess
.
sourcepub fn expect_upgrade_success(&mut self) -> &mut Self
pub fn expect_upgrade_success(&mut self) -> &mut Self
Expects upgrade success.
sourcepub fn get_handle_payment_contract(&self) -> Contract
pub fn get_handle_payment_contract(&self) -> Contract
Returns the “handle payment” contract, panics if it can’t be found.
sourcepub fn get_purse_balance(&self, purse: URef) -> U512
pub fn get_purse_balance(&self, purse: URef) -> U512
Returns the balance of a purse, panics if the balance can’t be parsed into a U512
.
sourcepub fn get_purse_balance_result(&self, purse: URef) -> BalanceResult
pub fn get_purse_balance_result(&self, purse: URef) -> BalanceResult
Returns a BalanceResult
for a purse, panics if the balance can’t be found.
sourcepub fn get_public_key_balance_result(
&self,
public_key: PublicKey
) -> BalanceResult
pub fn get_public_key_balance_result(
&self,
public_key: PublicKey
) -> BalanceResult
Returns a BalanceResult
for a purse using a PublicKey
.
sourcepub fn get_proposer_purse_balance(&self) -> U512
pub fn get_proposer_purse_balance(&self) -> U512
Gets the purse balance of a proposer.
sourcepub fn get_account(&self, account_hash: AccountHash) -> Option<Account>
pub fn get_account(&self, account_hash: AccountHash) -> Option<Account>
Queries for an Account
.
sourcepub fn get_expected_account(&self, account_hash: AccountHash) -> Account
pub fn get_expected_account(&self, account_hash: AccountHash) -> Account
Queries for an Account
and panics if it can’t be found.
sourcepub fn get_contract(&self, contract_hash: ContractHash) -> Option<Contract>
pub fn get_contract(&self, contract_hash: ContractHash) -> Option<Contract>
Queries for a contract by ContractHash
.
sourcepub fn get_contract_wasm(
&self,
contract_hash: ContractHash
) -> Option<ContractWasm>
pub fn get_contract_wasm(
&self,
contract_hash: ContractHash
) -> Option<ContractWasm>
Queries for a contract by ContractHash
and returns an Option<ContractWasm>
.
sourcepub fn get_contract_package(
&self,
contract_package_hash: ContractPackageHash
) -> Option<ContractPackage>
pub fn get_contract_package(
&self,
contract_package_hash: ContractPackageHash
) -> Option<ContractPackage>
Queries for a contract package by ContractPackageHash
.
sourcepub fn get_transfer(&self, transfer: TransferAddr) -> Option<Transfer>
pub fn get_transfer(&self, transfer: TransferAddr) -> Option<Transfer>
Queries for a transfer by TransferAddr
.
sourcepub fn get_deploy_info(&self, deploy_hash: DeployHash) -> Option<DeployInfo>
pub fn get_deploy_info(&self, deploy_hash: DeployHash) -> Option<DeployInfo>
Queries for deploy info by DeployHash
.
sourcepub fn exec_costs(&self, index: usize) -> Vec<Gas>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn exec_costs(&self, index: usize) -> Vec<Gas>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns a Vec<Gas>
representing execution consts.
sourcepub fn last_exec_gas_cost(&self) -> Gas
pub fn last_exec_gas_cost(&self) -> Gas
Returns the Gas
cost of the last exec.
sourcepub fn last_exec_result(&self) -> &ExecutionResult
pub fn last_exec_result(&self) -> &ExecutionResult
Returns the result of the last exec.
sourcepub fn assert_error(&self, expected_error: Error)
pub fn assert_error(&self, expected_error: Error)
Assert that last error is the expected one.
NOTE: we’re using string-based representation for checking equality
as the Error
type does not implement Eq
(many of its subvariants don’t).
sourcepub fn exec_error_message(&self, index: usize) -> Option<String>
pub fn exec_error_message(&self, index: usize) -> Option<String>
Returns the error message of the last exec.
sourcepub fn get_era_validators(&mut self) -> EraValidators
pub fn get_era_validators(&mut self) -> EraValidators
Gets EraValidators
.
sourcepub fn get_validator_weights(
&mut self,
era_id: EraId
) -> Option<ValidatorWeights>
pub fn get_validator_weights(
&mut self,
era_id: EraId
) -> Option<ValidatorWeights>
Gets ValidatorWeights
for a given EraId
.
sourcepub fn get_withdraws(&mut self) -> UnbondingPurses
pub fn get_withdraws(&mut self) -> UnbondingPurses
Gets UnbondingPurses
.
sourcepub fn get_balance_keys(&mut self) -> Vec<Key>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_balance_keys(&mut self) -> Vec<Key>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Gets all [Key::Balance]
s in global state.
sourcepub fn get_value<T>(&mut self, contract_hash: ContractHash, name: &str) -> T where
T: FromBytes + CLTyped,
pub fn get_value<T>(&mut self, contract_hash: ContractHash, name: &str) -> T where
T: FromBytes + CLTyped,
Gets a stored value from a contract’s named keys.
sourcepub fn get_auction_delay(&mut self) -> u64
pub fn get_auction_delay(&mut self) -> u64
Gets the auction delay.
sourcepub fn get_system_auction_hash(&self) -> ContractHash
pub fn get_system_auction_hash(&self) -> ContractHash
Gets the ContractHash
of the system auction contract, panics if it can’t be found.
sourcepub fn get_system_mint_hash(&self) -> ContractHash
pub fn get_system_mint_hash(&self) -> ContractHash
Gets the ContractHash
of the system mint contract, panics if it can’t be found.
sourcepub fn get_system_handle_payment_hash(&self) -> ContractHash
pub fn get_system_handle_payment_hash(&self) -> ContractHash
Gets the ContractHash
of the system handle payment contract, panics if it can’t be
found.
sourcepub fn get_system_standard_payment_hash(&self) -> ContractHash
pub fn get_system_standard_payment_hash(&self) -> ContractHash
Returns the ContractHash
of the system standard payment contract, panics if it can’t be
found.
sourcepub fn clear_results(&mut self) -> &mut Self
pub fn clear_results(&mut self) -> &mut Self
Resets the exec_results
, upgrade_results
and transform
fields.
Trait Implementations
sourceimpl<S> Clone for WasmTestBuilder<S>
impl<S> Clone for WasmTestBuilder<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for WasmTestBuilder<S> where
S: RefUnwindSafe,
impl<S> !Send for WasmTestBuilder<S>
impl<S> !Sync for WasmTestBuilder<S>
impl<S> Unpin for WasmTestBuilder<S>
impl<S> UnwindSafe for WasmTestBuilder<S> where
S: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
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,
Causes 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,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
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,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeDeref for T
impl<T> PipeDeref for T
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
impl<T> PipeRef for T
impl<T> PipeRef for T
impl<T> Tap for T
impl<T> Tap for T
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Provides immutable access for inspection. Read more
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Calls tap
in debug builds, and does nothing in release builds.
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Provides mutable access for modification. Read more
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Calls tap_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the reference for inspection.
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Calls tap_ref
in debug builds, and does nothing in release builds.
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the reference for modification.
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the borrow for inspection. Read more
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_borrow_mut
in debug builds, and does nothing in release
builds. Read more
impl<T> TapDeref for T
impl<T> TapDeref for T
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Calls tap_deref_mut
in debug builds, and does nothing in release
builds. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more