darkfi_contract_test_harness

Struct TestHarness

Source
pub struct TestHarness {
    pub holders: HashMap<Holder, Wallet>,
    pub proving_keys: HashMap<String, (ProvingKey, ZkBinary)>,
    pub genesis_block: BlockInfo,
    pub verify_fees: bool,
}
Expand description

Native contract test harness instance

Fields§

§holders: HashMap<Holder, Wallet>

Initialized Holders for this instance

§proving_keys: HashMap<String, (ProvingKey, ZkBinary)>

Cached [ProvingKey]s for native contract ZK proving

§genesis_block: BlockInfo

The genesis block for this harness

§verify_fees: bool

Marker to know if we’re supposed to include tx fees

Implementations§

Source§

impl TestHarness

Source

async fn pow_reward( &mut self, holder: &Holder, recipient: Option<&Holder>, reward: Option<u64>, fees: Option<u64>, ) -> Result<(Transaction, MoneyPoWRewardParamsV1)>

Create a Money::PoWReward transaction for a given Holder.

Optionally takes a specific reward recipient and a nonstandard reward value. Returns the created [Transaction] and [MoneyPoWRewardParamsV1].

Source

pub async fn generate_block( &mut self, miner: &Holder, holders: &[Holder], ) -> Result<Vec<OwnCoin>>

Generate and add an empty block to the given Holders blockchains. The miner holder will produce the block and receive the reward.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn create_empty_fee_call( &mut self, holder: &Holder, ) -> Result<(Transaction, MoneyFeeParamsV1)>

Create an empty transaction that includes a Money::Fee call. This is generally used to test the actual fee call, and also to see the gas usage of the call without other parts.

Source

pub async fn execute_empty_fee_call_tx( &mut self, holder: &Holder, tx: Transaction, params: &MoneyFeeParamsV1, block_height: u32, ) -> Result<Vec<OwnCoin>>

Execute the transaction created by create_empty_fee_call() for a given Holder

Returns any found [OwnCoin]s.

Source

pub async fn append_fee_call( &mut self, holder: &Holder, tx: Transaction, block_height: u32, spent_coins: &[OwnCoin], ) -> Result<(ContractCall, Vec<Proof>, Vec<SecretKey>, Vec<OwnCoin>, MoneyFeeParamsV1)>

Create and append a Money::Fee call to a given [Transaction] for a given Holder.

Additionally takes a set of spent coins in order not to reuse them here.

Returns the Fee call, and all necessary data and parameters related.

Source§

impl TestHarness

Source

pub async fn genesis_mint( &mut self, holder: &Holder, amounts: &[u64], spend_hook: Option<FuncId>, user_data: Option<Base>, ) -> Result<(Transaction, MoneyGenesisMintParamsV1)>

Create a Money::GenesisMint transaction for a given Holder.

Returns the created [Transaction] and its parameters.

Source

pub async fn execute_genesis_mint_tx( &mut self, holder: &Holder, tx: Transaction, params: &MoneyGenesisMintParamsV1, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the [Transaction] created by genesis_mint().

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn transfer( &mut self, amount: u64, holder: &Holder, recipient: &Holder, owncoins: &[OwnCoin], token_id: TokenId, block_height: u32, half_split: bool, ) -> Result<(Transaction, (MoneyTransferParamsV1, Option<MoneyFeeParamsV1>), Vec<OwnCoin>)>

Create a Money::Transfer transaction.

Source

pub async fn execute_transfer_tx( &mut self, holder: &Holder, tx: Transaction, call_params: &MoneyTransferParamsV1, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute a Money::Transfer transaction for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn token_mint( &mut self, amount: u64, holder: &Holder, recipient: &Holder, token_blind: BaseBlind, spend_hook: Option<FuncId>, user_data: Option<Base>, block_height: u32, ) -> Result<(Transaction, MoneyTokenMintParamsV1, MoneyAuthTokenMintParamsV1, Option<MoneyFeeParamsV1>)>

Mint an arbitrary token for a given recipient using Money::TokenMint

Source

pub async fn execute_token_mint_tx( &mut self, holder: &Holder, tx: Transaction, mint_params: &MoneyTokenMintParamsV1, auth_params: &MoneyAuthTokenMintParamsV1, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction created by token_mint() for a given Holder.

Returns any found [OwnCoin]s.

Source

pub async fn token_freeze( &mut self, holder: &Holder, block_height: u32, ) -> Result<(Transaction, MoneyAuthTokenFreezeParamsV1, Option<MoneyFeeParamsV1>)>

Freeze the supply of a minted token

Source

pub async fn execute_token_freeze_tx( &mut self, holder: &Holder, tx: Transaction, _freeze_params: &MoneyAuthTokenFreezeParamsV1, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction created by token_freeze() for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn otc_swap( &mut self, holder0: &Holder, owncoin0: &OwnCoin, holder1: &Holder, owncoin1: &OwnCoin, block_height: u32, ) -> Result<(Transaction, MoneyTransferParamsV1, Option<MoneyFeeParamsV1>)>

Create a Money::OtcSwap transaction with two given Holders.

Returns the [Transaction], and the transaction parameters.

Source

pub async fn execute_otc_swap_tx( &mut self, holder: &Holder, tx: Transaction, swap_params: &MoneyTransferParamsV1, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction created by otc_swap() for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn deploy_contract( &mut self, holder: &Holder, wasm_bincode: Vec<u8>, block_height: u32, ) -> Result<(Transaction, DeployParamsV1, Option<MoneyFeeParamsV1>)>

Create a Deployooor::Deploy transaction with the given WASM bincode.

Returns the [Transaction], and necessary parameters.

Source

pub async fn execute_deploy_tx( &mut self, holder: &Holder, tx: Transaction, _params: &DeployParamsV1, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction created by deploy_contract() for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn dao_mint( &mut self, holder: &Holder, dao: &Dao, dao_notes_secret_key: &SecretKey, dao_proposer_secret_key: &SecretKey, dao_proposals_secret_key: &SecretKey, dao_votes_secret_key: &SecretKey, dao_exec_secret_key: &SecretKey, dao_early_exec_secret_key: &SecretKey, block_height: u32, ) -> Result<(Transaction, DaoMintParams, Option<MoneyFeeParamsV1>)>

Create a Dao::Mint transaction with the given [Dao] info and keys. Takes a Holder for optionally paying the transaction fee.

Returns the [Transaction] and any relevant parameters.

Source

pub async fn execute_dao_mint_tx( &mut self, holder: &Holder, tx: Transaction, params: &DaoMintParams, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction created by dao_mint() for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn dao_propose_transfer( &mut self, proposer: &Holder, proposal_coinattrs: &[CoinAttributes], user_data: Base, dao: &Dao, dao_proposer_secret_key: &SecretKey, block_height: u32, duration_blockwindows: u64, ) -> Result<(Transaction, DaoProposeParams, Option<MoneyFeeParamsV1>, DaoProposal)>

Create a transfer Dao::Propose transaction.

Source

pub async fn dao_propose_generic( &mut self, proposer: &Holder, user_data: Base, dao: &Dao, dao_proposer_secret_key: &SecretKey, block_height: u32, duration_blockwindows: u64, ) -> Result<(Transaction, DaoProposeParams, Option<MoneyFeeParamsV1>, DaoProposal)>

Create a generic Dao::Propose transaction.

Source

pub async fn execute_dao_propose_tx( &mut self, holder: &Holder, tx: Transaction, params: &DaoProposeParams, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction created by dao_propose_*() for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn dao_vote( &mut self, voter: &Holder, vote_option: bool, dao: &Dao, proposal: &DaoProposal, block_height: u32, ) -> Result<(Transaction, DaoVoteParams, Option<MoneyFeeParamsV1>)>

Create a Dao::Vote transaction.

Source

pub async fn execute_dao_vote_tx( &mut self, holder: &Holder, tx: Transaction, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction made by dao_vote() for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn dao_exec_transfer( &mut self, holder: &Holder, dao: &Dao, dao_exec_secret_key: &SecretKey, dao_early_exec_secret_key: &Option<SecretKey>, proposal: &DaoProposal, proposal_coinattrs: Vec<CoinAttributes>, yes_vote_value: u64, all_vote_value: u64, yes_vote_blind: ScalarBlind, all_vote_blind: ScalarBlind, block_height: u32, ) -> Result<(Transaction, MoneyTransferParamsV1, Option<MoneyFeeParamsV1>)>

Create a transfer Dao::Exec transaction.

Source

pub async fn dao_exec_generic( &mut self, holder: &Holder, dao: &Dao, dao_exec_secret_key: &SecretKey, dao_early_exec_secret_key: &Option<SecretKey>, proposal: &DaoProposal, yes_vote_value: u64, all_vote_value: u64, yes_vote_blind: ScalarBlind, all_vote_blind: ScalarBlind, block_height: u32, ) -> Result<(Transaction, Option<MoneyFeeParamsV1>)>

Create a generic Dao::Exec transaction.

Source

pub async fn execute_dao_exec_tx( &mut self, holder: &Holder, tx: Transaction, xfer_params: Option<&MoneyTransferParamsV1>, fee_params: &Option<MoneyFeeParamsV1>, block_height: u32, append: bool, ) -> Result<Vec<OwnCoin>>

Execute the transaction made by dao_exec_*() for a given Holder.

Returns any found [OwnCoin]s.

Source§

impl TestHarness

Source

pub async fn new(holders: &[Holder], verify_fees: bool) -> Result<Self>

Instantiate a new TestHarness given a slice of Holders. Additionally, a verify_fees boolean will enforce tx fee verification.

Source

pub fn assert_trees(&self, holders: &[Holder])

Assert that all holders’ trees are the same

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

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<T> Downcast for T
where T: Any,

§

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

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

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

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

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

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

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
§

impl<T> LayoutRaw for T

§

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

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

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 metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

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>,

Source§

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>,

Source§

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