Skip to main content

BlokliTestClient

Struct BlokliTestClient 

Source
pub struct BlokliTestClient<M> { /* private fields */ }
Expand description

In-memory Blokli client for tests.

BlokliTestClient implements BlokliQueryClient, BlokliSubscriptionClient, and BlokliTransactionClient against a shared BlokliTestState. Clones share the same state and broadcast channels, which makes it possible to submit simulated transactions from one handle and observe subscription updates from another.

Transactions submitted through the client call the configured BlokliTestStateMutator. Mutations that remove accounts, channels, balances, allowances, or active transactions are rejected to avoid producing inconsistent test state. For direct fixture edits that should not emit subscription events, use hidden_state_update.

This type is exported only with the testing feature.

Implementations§

Source§

impl<M: BlokliTestStateMutator> BlokliTestClient<M>

Source

pub fn new(initial_state: BlokliTestState, mutator: M) -> Self

Constructs a new client that owns the given initial_state.

After construction, the only way to mutate the state is when the client calls the given mutator based on a submitted transaction.

Source

pub fn with_mutator(self, mutator: M) -> Self

Replaces the transaction mutator.

The returned client keeps the same shared state and subscription channels.

Source

pub fn with_use_internal_txs(self, use_internal_txs: bool) -> Self

Enables or disables internal safe transaction simulation.

When enabled, a mutator error wrapped in InternalTxError produces a confirmed outer transaction with failed safe execution details. The default is disabled.

Source

pub fn with_tx_simulation_delay(self, tx_simulation_delay: Duration) -> Self

Sets the delay before a simulated transaction is confirmed or emitted by tracking streams.

The default is 1 second.

Source

pub fn snapshot(&self) -> BlokliTestStateSnapshot

Returns the current snapshot of the internal state.

The snapshot can be repeatedly refreshed to get the latest state.

Source

pub fn hidden_state_update(&self, update: impl FnOnce(&mut BlokliTestState))

Performs an arbitrary state update without broadcasting subscription events.

This is useful for arranging fixtures between assertions. Use transaction submission or update_price_and_win_prob when tests need subscribers to observe the change.

Source

pub fn update_price_and_win_prob( &self, new_price: Option<TokenValueString>, new_win_prob: Option<f64>, )

Updates the ticket price and/or minimum ticket-winning probability.

These changes update the shared state and broadcast a TicketParameters event to active subscribers when at least one value changes.

Trait Implementations§

Source§

impl<M: BlokliTestStateMutator + Send + Sync> BlokliQueryClient for BlokliTestClient<M>

Source§

fn query_curvy_pending_notes<'life0, 'async_trait>( &'life0 self, _from_block: Option<u64>, _after: Option<CurvyEventCursor>, _first: u32, ) -> Pin<Box<dyn Future<Output = Result<CurvyPendingNotes, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a chain-ordered page of Curvy pending notes. Read more
Source§

fn query_curvy_committed_notes<'life0, 'async_trait>( &'life0 self, _from_block: Option<u64>, _after: Option<CurvyEventCursor>, _first: u32, ) -> Pin<Box<dyn Future<Output = Result<CurvyCommittedNotes, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a chain-ordered page of committed Curvy notes.
Source§

fn query_curvy_committed_nullifiers<'life0, 'async_trait>( &'life0 self, _from_block: Option<u64>, _after: Option<CurvyEventCursor>, _first: u32, ) -> Pin<Box<dyn Future<Output = Result<CurvyCommittedNullifiers, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a chain-ordered page of committed Curvy nullifiers.
Source§

fn query_curvy_sync_checkpoint<'life0, 'async_trait>( &'life0 self, _block_hash: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<CurvySyncCheckpoint, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the latest finalized Curvy sync checkpoint, or the checkpoint pinned by block hash.
Source§

fn query_curvy_sync_notes<'life0, 'async_trait>( &'life0 self, _checkpoint: String, _from_index: Option<u64>, _first: u32, ) -> Pin<Box<dyn Future<Output = Result<CurvySyncNotePage, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a checkpoint-pinned page of dense committed notes.
Source§

fn query_curvy_sync_nullifiers<'life0, 'async_trait>( &'life0 self, _checkpoint: String, _from_index: Option<u64>, _first: u32, ) -> Pin<Box<dyn Future<Output = Result<CurvySyncNullifierPage, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a checkpoint-pinned page of dense committed nullifiers.
Source§

fn query_curvy_shard_roots<'life0, 'async_trait>( &'life0 self, _checkpoint: String, _from_index: Option<u64>, _first: u32, ) -> Pin<Box<dyn Future<Output = Result<CurvyShardRootPage, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a checkpoint-pinned page of completed notes-tree shard roots.
Source§

fn query_curvy_aggregator_state<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CurvyAggregatorState, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reads current Curvy Aggregator indices and notes-tree root from chain.
Source§

fn query_curvy_note_status<'life0, 'async_trait>( &'life0 self, _note_id: String, ) -> Pin<Box<dyn Future<Output = Result<CurvyNoteStatus, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reads a Curvy note’s raw status from chain.
Source§

fn query_curvy_valid_notes_root<'life0, 'async_trait>( &'life0 self, _root: String, ) -> Pin<Box<dyn Future<Output = Result<bool, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks whether a Curvy notes-tree root is valid.
Source§

fn query_curvy_nullifier_spent<'life0, 'async_trait>( &'life0 self, _nullifier: String, ) -> Pin<Box<dyn Future<Output = Result<bool, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks whether a Curvy nullifier has already been spent.
Source§

fn query_curvy_vault_fees<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CurvyVaultFees, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reads Curvy Vault protocol-level fees.
Source§

fn query_curvy_aggregator_fees<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CurvyAggregatorFees, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reads Curvy Aggregator proof fee configuration.
Source§

fn query_curvy_vault_token_count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CurvyVaultTokenCount, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reads the number of registered Curvy Vault tokens.
Source§

fn query_curvy_vault_token<'life0, 'async_trait>( &'life0 self, _token_id: String, ) -> Pin<Box<dyn Future<Output = Result<CurvyVaultToken, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reads one Curvy Vault token and its gas fee configuration.
Source§

fn query_curvy_entry_portal_address<'life0, 'async_trait>( &'life0 self, _owner_hash: String, _recovery: String, ) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Derives a Curvy entry portal address.
Source§

fn query_curvy_exit_portal_address<'life0, 'async_trait>( &'life0 self, _exit_address: String, _exit_chain_id: String, _recovery: String, ) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Derives a Curvy exit portal address.
Source§

fn query_curvy_portal_registered<'life0, 'async_trait>( &'life0 self, _portal_address: String, ) -> Pin<Box<dyn Future<Output = Result<bool, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks whether a portal is registered with Curvy PortalFactory.
Source§

fn count_accounts<'life0, 'async_trait>( &'life0 self, selector: AccountSelector, ) -> Pin<Box<dyn Future<Output = Result<u32, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Counts accounts matching the given AccountSelector. Read more
Source§

fn query_accounts<'life0, 'async_trait>( &'life0 self, selector: AccountSelector, ) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns accounts matching the given AccountSelector. Read more
Source§

fn query_native_balance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 ChainAddress, ) -> Pin<Box<dyn Future<Output = Result<NativeBalance, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the native-chain balance for an account or safe address. Read more
Source§

fn query_token_balance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 ChainAddress, _token: Token, ) -> Pin<Box<dyn Future<Output = Result<HoprBalance, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the HOPR token balance for an account or safe address.
Source§

fn query_transaction_count<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 ChainAddress, ) -> Pin<Box<dyn Future<Output = Result<u64, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the number of indexed transactions sent from the given address.
Source§

fn query_safe_allowance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 ChainAddress, ) -> Pin<Box<dyn Future<Output = Result<SafeHoprAllowance, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the HOPR token allowance configured for a safe address.
Source§

fn query_redeemed_stats<'life0, 'async_trait>( &'life0 self, selector: RedeemedStatsSelector, ) -> Pin<Box<dyn Future<Output = Result<RedeemedStats, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns redeemed and rejected ticket aggregates filtered by safe, node, or both. Read more
Source§

fn query_safe<'life0, 'async_trait>( &'life0 self, selector: SafeSelector, ) -> Pin<Box<dyn Future<Output = Result<Vec<Safe>, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns deployed safes matching the given SafeSelector.
Source§

fn query_module_address_prediction<'life0, 'async_trait>( &'life0 self, input: ModulePredictionInput, ) -> Pin<Box<dyn Future<Output = Result<ChainAddress, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the predicted module address for the given safe deployment data.
Source§

fn count_channels<'life0, 'async_trait>( &'life0 self, selector: ChannelSelector, ) -> Pin<Box<dyn Future<Output = Result<u32, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

👎Deprecated since 0.22.0:

Use query_channel_stats instead, which returns both count and total wxHOPR balance.

Counts channels matching the given ChannelSelector. Read more
Source§

fn query_channel_stats<'life0, 'async_trait>( &'life0 self, selector: ChannelSelector, ) -> Pin<Box<dyn Future<Output = Result<ChannelStats, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns channel count and total wxHOPR balance matching the given ChannelSelector. Read more
Source§

fn query_channels<'life0, 'async_trait>( &'life0 self, selector: ChannelSelector, ) -> Pin<Box<dyn Future<Output = Result<ChannelsList, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns channels matching the given ChannelSelector. Read more
Source§

fn query_safes_balance<'life0, 'async_trait>( &'life0 self, owner_address: Option<ChainAddress>, ) -> Pin<Box<dyn Future<Output = Result<SafesBalance, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the total wxHOPR balance held across indexed safe contracts. Read more
Source§

fn count_services<'life0, 'async_trait>( &'life0 self, selector: ServiceSelector, ) -> Pin<Box<dyn Future<Output = Result<u32, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Counts service registry entries matching the given ServiceSelector. Read more
Source§

fn query_services<'life0, 'async_trait>( &'life0 self, selector: ServiceSelector, ) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceEntry>, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns service registry entries matching the given ServiceSelector. Read more
Source§

fn query_live_services<'life0, 'async_trait>( &'life0 self, selector: ServiceSelector, ) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceEntry>, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns only entries whose node is currently bound in the NodeSafeRegistry selected by the service registry itself.
Source§

fn query_service_types<'life0, 'async_trait>( &'life0 self, service_type: Option<ServiceTypeId>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceTypeInfo>, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns service type configuration, optionally restricted to a single type. Read more
Source§

fn query_service_registry_config<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ServiceRegistryConfig, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the current registry-wide type registration fee and node-safe registry pointer. Read more
Source§

fn query_transaction_status<'life0, 'async_trait>( &'life0 self, tx_id: TxId, ) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the latest known status for a tracked transaction id. Read more
Source§

fn query_chain_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ChainInfo, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns chain, contract, fee, ticket, and timing parameters reported by Blokli.
Source§

fn query_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the Blokli server version string.
Source§

fn query_health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the current health state as reported by the legacy health query.
Source§

fn query_compatibility<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Compatibility, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Queries server compatibility information. Read more
Source§

impl<M: BlokliTestStateMutator + Send + Sync> BlokliSubscriptionClient for BlokliTestClient<M>

Source§

fn subscribe_services( &self, selector: ServiceSelector, ) -> Result<impl Stream<Item = Result<ServiceUpdate, BlokliClientError>> + Send, BlokliClientError>

Streams current matching entries followed by changes produced by simulated transactions.

Source§

fn subscribe_service_types( &self, service_type: Option<ServiceTypeId>, ) -> Result<impl Stream<Item = Result<ServiceTypeUpdate, BlokliClientError>> + Send, BlokliClientError>

Streams service type configuration changes produced by simulated transactions.

The two registry-wide kinds, ServiceTypeUpdateKind::RegistrationFeeChanged and ServiceTypeUpdateKind::RegistryPointerChanged, are never emitted: BlokliTestState models per-type configuration only.

Source§

fn subscribe_channels( &self, selector: ChannelSelector, ) -> Result<impl Stream<Item = Result<Channel, BlokliClientError>> + Send, BlokliClientError>

Streams channel updates matching the given ChannelSelector. Read more
Source§

fn subscribe_accounts( &self, selector: AccountSelector, ) -> Result<impl Stream<Item = Result<Account, BlokliClientError>> + Send, BlokliClientError>

Streams account updates matching the given AccountSelector. Read more
Source§

fn subscribe_graph( &self, ) -> Result<impl Stream<Item = Result<OpenedChannelsGraphEntry, BlokliClientError>> + Send, BlokliClientError>

Streams updates for the open-channel graph. Read more
Source§

fn subscribe_ticket_params( &self, ) -> Result<impl Stream<Item = Result<TicketParameters, BlokliClientError>> + Send, BlokliClientError>

Streams updates of ticket price and winning-probability parameters.
Source§

fn subscribe_health( &self, ) -> Result<impl Stream<Item = Result<ReadinessState, BlokliClientError>> + Send, BlokliClientError>

Streams readiness updates for the Blokli instance.
Source§

fn subscribe_safe_deployments( &self, ) -> Result<impl Stream<Item = Result<Safe, BlokliClientError>> + Send, BlokliClientError>

Streams on-chain safe deployments indexed by Blokli.
Source§

fn subscribe_service_registry_config( &self, ) -> Result<impl Stream<Item = Result<ServiceRegistryConfig, BlokliClientError>> + Send + 'static, BlokliClientError>

Streams the complete registry-wide configuration. Read more
Source§

fn subscribe_track_transaction( &self, tx_id: TxId, ) -> Result<impl Stream<Item = Result<Transaction, BlokliClientError>> + Send, BlokliClientError>

Streams status updates for a tracked transaction id. Read more
Source§

fn subscribe_ticket_redeemed( &self, _selector: TicketSelector, ) -> Result<impl Stream<Item = Result<RedeemTicketDetails, BlokliClientError>> + Send, BlokliClientError>

Subscribes to on-chain ticket redemption events matching the given TicketSelector. Read more
Source§

fn subscribe_curvy_pending_notes( &self, _from_block: Option<u64>, ) -> Result<impl Stream<Item = Result<CurvyPendingNote, BlokliClientError>> + Send, BlokliClientError>

Streams all pending Curvy notes from an optional inclusive block. Read more
Source§

fn subscribe_curvy_committed_notes( &self, _from_block: Option<u64>, ) -> Result<impl Stream<Item = Result<CurvyCommittedNote, BlokliClientError>> + Send, BlokliClientError>

Streams all committed Curvy notes from an optional inclusive block. Read more
Source§

fn subscribe_curvy_committed_nullifiers( &self, _from_block: Option<u64>, ) -> Result<impl Stream<Item = Result<CurvyCommittedNullifier, BlokliClientError>> + Send, BlokliClientError>

Streams committed Curvy nullifiers from an optional inclusive block.
Source§

impl<M: BlokliTestStateMutator + Send + Sync> BlokliTransactionClient for BlokliTestClient<M>

Source§

fn submit_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signed_tx: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<TxReceipt, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submits a signed transaction and returns the on-chain transaction hash reported by Blokli. Read more
Source§

fn submit_and_track_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signed_tx: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<TxId, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submits a signed transaction and returns a Blokli tracking id. Read more
Source§

fn submit_and_confirm_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signed_tx: &'life1 [u8], num_confirmations: usize, ) -> Pin<Box<dyn Future<Output = Result<TxReceipt, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submits a signed transaction and waits for the requested number of confirmations. Read more
Source§

fn track_transaction<'life0, 'async_trait>( &'life0 self, tx_id: TxId, client_timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Tracks the transaction given the tx_id previously returned by submit_and_track_transaction until it is confirmed or fails.
Source§

impl<M: Clone> Clone for BlokliTestClient<M>

Source§

fn clone(&self) -> BlokliTestClient<M>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for BlokliTestClient<M>

§

impl<M> !UnwindSafe for BlokliTestClient<M>

§

impl<M> Freeze for BlokliTestClient<M>
where M: Freeze,

§

impl<M> Send for BlokliTestClient<M>
where M: Send,

§

impl<M> Sync for BlokliTestClient<M>
where M: Sync,

§

impl<M> Unpin for BlokliTestClient<M>
where M: Unpin,

§

impl<M> UnsafeUnpin for BlokliTestClient<M>
where M: UnsafeUnpin,

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more