Struct WalletDb

Source
pub struct WalletDb<C, P, CL, R> { /* private fields */ }
Expand description

A wrapper for the SQLite connection to the wallet database, along with a capability to read the system from the clock. A WalletDb encapsulates the full set of capabilities that are required in order to implement the WalletRead, WalletWrite and WalletCommitmentTrees traits.

Implementations§

Source§

impl<P, CL, R> WalletDb<Connection, P, CL, R>

Source

pub fn for_path<F: AsRef<Path>>( path: F, params: P, clock: CL, rng: R, ) -> Result<Self, Error>

Construct a WalletDb instance that connects to the wallet database stored at the specified path.

§Parameters
  • path: The path to the SQLite database used to store wallet data.
  • params: Parameters associated with the Zcash network that the wallet will connect to.
  • clock: The clock to use in the case that the backend needs access to the system time.
  • rng: The random number generation capability to be exposed by the created WalletDb instance.
Source§

impl<C, P, CL, R> WalletDb<C, P, CL, R>

Source

pub fn with_gap_limits(self, gap_limits: GapLimits) -> Self

Available on crate feature transparent-inputs only.

Sets the gap limits to be used by the wallet in transparent address generation.

Source§

impl<C: Borrow<Connection>, P, CL, R> WalletDb<C, P, CL, R>

Source

pub fn from_connection(conn: C, params: P, clock: CL, rng: R) -> Self

Constructs a new wrapper around the given connection.

This is provided for use cases such as connection pooling, where conn may be an &mut rusqlite::Connection.

The caller must ensure that [rusqlite::vtab::array::load_module] has been called on the connection.

§Parameters
  • conn: A connection to the wallet database.
  • params: Parameters associated with the Zcash network that the wallet will connect to.
  • clock: The clock to use in the case that the backend needs access to the system time.
  • rng: The random number generation capability to be exposed by the created WalletDb instance.
Source§

impl<C: BorrowMut<Connection>, P, CL, R> WalletDb<C, P, CL, R>

Source

pub fn transactionally<F, A, E: From<Error>>(&mut self, f: F) -> Result<A, E>
where F: FnOnce(&mut WalletDb<SqlTransaction<'_>, &P, &CL, &mut R>) -> Result<A, E>,

Source

pub fn check_witnesses( &mut self, ) -> Result<Vec<Range<BlockHeight>>, SqliteClientError>

Attempts to construct a witness for each note belonging to the wallet that is believed by the wallet to currently be spendable, and returns a vector of the ranges that must be rescanned in order to correct missing witness data.

This method is intended for repairing wallets that broke due to bugs in shardtree.

Source

pub fn queue_rescans( &mut self, rescan_ranges: NonEmpty<Range<BlockHeight>>, priority: ScanPriority, ) -> Result<(), SqliteClientError>

Updates the scan queue by inserting scan ranges for the given range of block heights, with the specified scanning priority.

Source§

impl<C: BorrowMut<Connection>, P, CL: Clock, R: RngCore> WalletDb<C, P, CL, R>

Source

pub fn schedule_ephemeral_address_checks( &mut self, ) -> Result<(), SqliteClientError>

Available on crate feature transparent-inputs only.

For each ephemeral address in the wallet, ensure that the transaction data request queue contains a request for the wallet to check for UTXOs belonging to that address at some time during the next 24-hour period.

We use randomized scheduling of ephemeral address checks to ensure that a lightwalletd-compromising adversary cannot use temporal clustering to determine what ephemeral addresses belong to a given wallet.

Trait Implementations§

Source§

impl<C: Borrow<Connection>, P: Parameters, CL, R> InputSource for WalletDb<C, P, CL, R>

Source§

fn get_account_metadata( &self, account_id: Self::AccountId, selector: &NoteFilter, exclude: &[Self::NoteRef], ) -> Result<AccountMeta, Self::Error>

Returns metadata for the spendable notes in the wallet.

Source§

type Error = SqliteClientError

The type of errors produced by a wallet backend.
Source§

type NoteRef = ReceivedNoteId

Backend-specific note identifier. Read more
Source§

type AccountId = AccountUuid

Backend-specific account identifier. Read more
Source§

fn get_spendable_note( &self, txid: &TxId, protocol: ShieldedProtocol, index: u32, ) -> Result<Option<ReceivedNote<Self::NoteRef, Note>>, Self::Error>

Fetches a spendable note by indexing into a transaction’s shielded outputs for the specified shielded protocol. Read more
Source§

fn select_spendable_notes( &self, account: Self::AccountId, target_value: Zatoshis, sources: &[ShieldedProtocol], anchor_height: BlockHeight, exclude: &[Self::NoteRef], ) -> Result<SpendableNotes<Self::NoteRef>, Self::Error>

Returns a list of spendable notes sufficient to cover the specified target value, if possible. Only spendable notes corresponding to the specified shielded protocol will be included.
Source§

fn get_unspent_transparent_output( &self, outpoint: &OutPoint, ) -> Result<Option<WalletTransparentOutput>, Self::Error>

Fetches the transparent output corresponding to the provided outpoint. Read more
Source§

fn get_spendable_transparent_outputs( &self, address: &TransparentAddress, target_height: BlockHeight, min_confirmations: u32, ) -> Result<Vec<WalletTransparentOutput>, Self::Error>

Returns the list of spendable transparent outputs received by this wallet at address such that, at height target_height: Read more
Source§

impl<C: BorrowMut<Connection>, P: Parameters, CL, R> WalletCommitmentTrees for WalletDb<C, P, CL, R>

Source§

type Error = Error

Source§

type SaplingShardStore<'a> = SqliteShardStore<&'a Transaction<'a>, Node, SAPLING_SHARD_HEIGHT>

The type of the backing [ShardStore] for the Sapling note commitment tree.
Source§

type OrchardShardStore<'a> = SqliteShardStore<&'a Transaction<'a>, MerkleHashOrchard, ORCHARD_SHARD_HEIGHT>

The type of the backing [ShardStore] for the Orchard note commitment tree.
Source§

fn with_sapling_tree_mut<F, A, E>(&mut self, callback: F) -> Result<A, E>
where for<'a> F: FnMut(&'a mut ShardTree<SqliteShardStore<&'a Transaction<'a>, Node, SAPLING_SHARD_HEIGHT>, { sapling::NOTE_COMMITMENT_TREE_DEPTH }, SAPLING_SHARD_HEIGHT>) -> Result<A, E>, E: From<ShardTreeError<Self::Error>>,

Evaluates the given callback function with a reference to the Sapling note commitment tree maintained by the wallet.
Source§

fn put_sapling_subtree_roots( &mut self, start_index: u64, roots: &[CommitmentTreeRoot<Node>], ) -> Result<(), ShardTreeError<Self::Error>>

Adds a sequence of Sapling note commitment tree subtree roots to the data store. Read more
Source§

fn with_orchard_tree_mut<F, A, E>(&mut self, callback: F) -> Result<A, E>
where for<'a> F: FnMut(&'a mut ShardTree<SqliteShardStore<&'a Transaction<'a>, MerkleHashOrchard, ORCHARD_SHARD_HEIGHT>, { _ }, ORCHARD_SHARD_HEIGHT>) -> Result<A, E>, E: From<ShardTreeError<Self::Error>>,

Evaluates the given callback function with a reference to the Orchard note commitment tree maintained by the wallet.
Source§

fn put_orchard_subtree_roots( &mut self, start_index: u64, roots: &[CommitmentTreeRoot<MerkleHashOrchard>], ) -> Result<(), ShardTreeError<Self::Error>>

Adds a sequence of Orchard note commitment tree subtree roots to the data store. Read more
Source§

impl<P: Parameters, CL, R> WalletCommitmentTrees for WalletDb<SqlTransaction<'_>, P, CL, R>

Source§

type Error = Error

Source§

type SaplingShardStore<'a> = SqliteShardStore<&'a Transaction<'a>, Node, SAPLING_SHARD_HEIGHT>

The type of the backing [ShardStore] for the Sapling note commitment tree.
Source§

type OrchardShardStore<'a> = SqliteShardStore<&'a Transaction<'a>, MerkleHashOrchard, ORCHARD_SHARD_HEIGHT>

The type of the backing [ShardStore] for the Orchard note commitment tree.
Source§

fn with_sapling_tree_mut<F, A, E>(&mut self, callback: F) -> Result<A, E>
where for<'a> F: FnMut(&'a mut ShardTree<SqliteShardStore<&'a Transaction<'a>, Node, SAPLING_SHARD_HEIGHT>, { sapling::NOTE_COMMITMENT_TREE_DEPTH }, SAPLING_SHARD_HEIGHT>) -> Result<A, E>, E: From<ShardTreeError<Error>>,

Evaluates the given callback function with a reference to the Sapling note commitment tree maintained by the wallet.
Source§

fn put_sapling_subtree_roots( &mut self, start_index: u64, roots: &[CommitmentTreeRoot<Node>], ) -> Result<(), ShardTreeError<Self::Error>>

Adds a sequence of Sapling note commitment tree subtree roots to the data store. Read more
Source§

fn with_orchard_tree_mut<F, A, E>(&mut self, callback: F) -> Result<A, E>
where for<'a> F: FnMut(&'a mut ShardTree<SqliteShardStore<&'a Transaction<'a>, MerkleHashOrchard, ORCHARD_SHARD_HEIGHT>, { _ }, ORCHARD_SHARD_HEIGHT>) -> Result<A, E>, E: From<ShardTreeError<Self::Error>>,

Evaluates the given callback function with a reference to the Orchard note commitment tree maintained by the wallet.
Source§

fn put_orchard_subtree_roots( &mut self, start_index: u64, roots: &[CommitmentTreeRoot<MerkleHashOrchard>], ) -> Result<(), ShardTreeError<Self::Error>>

Adds a sequence of Orchard note commitment tree subtree roots to the data store. Read more
Source§

impl<C: Borrow<Connection>, P: Parameters, CL, R> WalletRead for WalletDb<C, P, CL, R>

Source§

type Error = SqliteClientError

The type of errors that may be generated when querying a wallet data store.
Source§

type AccountId = AccountUuid

The type of the account identifier. Read more
Source§

type Account = Account

The concrete account type used by this wallet backend.
Source§

fn get_account_ids(&self) -> Result<Vec<Self::AccountId>, Self::Error>

Returns a vector with the IDs of all accounts known to this wallet.
Source§

fn get_account( &self, account_id: Self::AccountId, ) -> Result<Option<Self::Account>, Self::Error>

Returns the account corresponding to the given ID, if any.
Source§

fn get_derived_account( &self, seed: &SeedFingerprint, account_id: AccountId, ) -> Result<Option<Self::Account>, Self::Error>

Returns the account corresponding to a given [SeedFingerprint] and [zip32::AccountId], if any.
Source§

fn validate_seed( &self, account_id: Self::AccountId, seed: &SecretVec<u8>, ) -> Result<bool, Self::Error>

Verifies that the given seed corresponds to the viewing key for the specified account. Read more
Source§

fn seed_relevance_to_derived_accounts( &self, seed: &SecretVec<u8>, ) -> Result<SeedRelevance<Self::AccountId>, Self::Error>

Checks whether the given seed is relevant to any of the derived accounts (where Account::source is AccountSource::Derived) in the wallet. Read more
Source§

fn get_account_for_ufvk( &self, ufvk: &UnifiedFullViewingKey, ) -> Result<Option<Self::Account>, Self::Error>

Returns the account corresponding to a given UnifiedFullViewingKey, if any.
Source§

fn list_addresses( &self, account: Self::AccountId, ) -> Result<Vec<AddressInfo>, Self::Error>

Returns information about every address tracked for this account.
Source§

fn get_last_generated_address_matching( &self, account: Self::AccountId, request: UnifiedAddressRequest, ) -> Result<Option<UnifiedAddress>, Self::Error>

Returns the most recently generated unified address for the specified account that conforms to the specified address filter, if the account identifier specified refers to a valid account for this wallet. Read more
Source§

fn get_account_birthday( &self, account: Self::AccountId, ) -> Result<BlockHeight, Self::Error>

Returns the birthday height for the given account, or an error if the account is not known to the wallet.
Source§

fn get_wallet_birthday(&self) -> Result<Option<BlockHeight>, Self::Error>

Returns the birthday height for the wallet. Read more
Source§

fn get_wallet_summary( &self, min_confirmations: u32, ) -> Result<Option<WalletSummary<Self::AccountId>>, Self::Error>

Returns a WalletSummary that represents the sync status, and the wallet balances given the specified minimum number of confirmations for all accounts known to the wallet; or Ok(None) if the wallet has no summary data available.
Source§

fn chain_height(&self) -> Result<Option<BlockHeight>, Self::Error>

Returns the height of the chain as known to the wallet as of the most recent call to WalletWrite::update_chain_tip. Read more
Source§

fn get_block_hash( &self, block_height: BlockHeight, ) -> Result<Option<BlockHash>, Self::Error>

Returns the block hash for the block at the given height, if the associated block data is available. Returns Ok(None) if the hash is not found in the database.
Source§

fn block_metadata( &self, height: BlockHeight, ) -> Result<Option<BlockMetadata>, Self::Error>

Returns the available block metadata for the block at the specified height, if any.
Source§

fn block_fully_scanned(&self) -> Result<Option<BlockMetadata>, Self::Error>

Returns the metadata for the block at the height to which the wallet has been fully scanned. Read more
Source§

fn get_max_height_hash( &self, ) -> Result<Option<(BlockHeight, BlockHash)>, Self::Error>

Returns the block height and hash for the block at the maximum scanned block height. Read more
Source§

fn block_max_scanned(&self) -> Result<Option<BlockMetadata>, Self::Error>

Returns block metadata for the maximum height that the wallet has scanned. Read more
Source§

fn suggest_scan_ranges(&self) -> Result<Vec<ScanRange>, Self::Error>

Returns a vector of suggested scan ranges based upon the current wallet state. Read more
Source§

fn get_target_and_anchor_heights( &self, min_confirmations: NonZeroU32, ) -> Result<Option<(BlockHeight, BlockHeight)>, Self::Error>

Returns the default target height (for the block in which a new transaction would be mined) and anchor height (to use for a new transaction), given the range of block heights that the backend knows about. Read more
Source§

fn get_tx_height(&self, txid: TxId) -> Result<Option<BlockHeight>, Self::Error>

Returns the block height in which the specified transaction was mined, or Ok(None) if the transaction is not in the main chain.
Source§

fn get_unified_full_viewing_keys( &self, ) -> Result<HashMap<Self::AccountId, UnifiedFullViewingKey>, Self::Error>

Returns all unified full viewing keys known to this wallet.
Source§

fn get_memo(&self, note_id: NoteId) -> Result<Option<Memo>, Self::Error>

Returns the memo for a note. Read more
Source§

fn get_transaction( &self, txid: TxId, ) -> Result<Option<Transaction>, Self::Error>

Returns a transaction.
Source§

fn get_sapling_nullifiers( &self, query: NullifierQuery, ) -> Result<Vec<(Self::AccountId, Nullifier)>, Self::Error>

Returns the nullifiers for Sapling notes that the wallet is tracking, along with their associated account IDs, that are either unspent or have not yet been confirmed as spent (in that a spending transaction known to the wallet has not yet been included in a block).
Source§

fn get_orchard_nullifiers( &self, query: NullifierQuery, ) -> Result<Vec<(Self::AccountId, Nullifier)>, Self::Error>

Returns the nullifiers for Orchard notes that the wallet is tracking, along with their associated account IDs, that are either unspent or have not yet been confirmed as spent (in that a spending transaction known to the wallet has not yet been included in a block).
Source§

fn get_transparent_receivers( &self, account: Self::AccountId, include_change: bool, ) -> Result<HashMap<TransparentAddress, Option<TransparentAddressMetadata>>, Self::Error>

Returns the set of non-ephemeral transparent receivers associated with the given account controlled by this wallet. Read more
Source§

fn get_transparent_balances( &self, account: Self::AccountId, max_height: BlockHeight, ) -> Result<HashMap<TransparentAddress, Zatoshis>, Self::Error>

Returns a mapping from each transparent receiver associated with the specified account to its not-yet-shielded UTXO balance as of the end of the block at the provided max_height, when that balance is non-zero. Read more
Source§

fn get_transparent_address_metadata( &self, account: Self::AccountId, address: &TransparentAddress, ) -> Result<Option<TransparentAddressMetadata>, Self::Error>

Returns the metadata associated with a given transparent receiver in an account controlled by this wallet, if available. Read more
Source§

fn utxo_query_height( &self, account: Self::AccountId, ) -> Result<BlockHeight, Self::Error>

Returns the maximum block height at which a transparent output belonging to the wallet has been observed. Read more
Source§

fn get_known_ephemeral_addresses( &self, account: Self::AccountId, index_range: Option<Range<NonHardenedChildIndex>>, ) -> Result<Vec<(TransparentAddress, TransparentAddressMetadata)>, Self::Error>

Returns a vector of ephemeral transparent addresses associated with the given account controlled by this wallet, along with their metadata. The result includes reserved addresses, and addresses for the backend’s configured gap limit worth of additional indices (capped to the maximum index). Read more
Source§

fn find_account_for_ephemeral_address( &self, address: &TransparentAddress, ) -> Result<Option<Self::AccountId>, Self::Error>

If a given ephemeral address might have been reserved, i.e. would be included in the result of get_known_ephemeral_addresses(account_id, None) for any of the wallet’s accounts, then return Ok(Some(account_id)). Otherwise return Ok(None). Read more
Source§

fn transaction_data_requests( &self, ) -> Result<Vec<TransactionDataRequest>, Self::Error>

Returns a vector of TransactionDataRequest values that describe information needed by the wallet to complete its view of transaction history. Read more
Source§

impl<C: Borrow<Connection>, P: Parameters, CL, R> WalletTest for WalletDb<C, P, CL, R>

Available on crate feature test-dependencies only.
Source§

fn get_tx_history( &self, ) -> Result<Vec<TransactionSummary<<Self as WalletRead>::AccountId>>, <Self as WalletRead>::Error>

Returns a vector of transaction summaries. Read more
Source§

fn get_sent_note_ids( &self, txid: &TxId, protocol: ShieldedProtocol, ) -> Result<Vec<NoteId>, <Self as WalletRead>::Error>

Returns the note IDs for shielded notes sent by the wallet in a particular transaction.
Source§

fn get_sent_outputs( &self, txid: &TxId, ) -> Result<Vec<OutputOfSentTx>, <Self as WalletRead>::Error>

Returns the outputs for a transaction sent by the wallet.
Source§

fn get_checkpoint_history( &self, protocol: &ShieldedProtocol, ) -> Result<Vec<(BlockHeight, Option<Position>)>, <Self as WalletRead>::Error>

Source§

fn get_transparent_output( &self, outpoint: &OutPoint, allow_unspendable: bool, ) -> Result<Option<WalletTransparentOutput>, <Self as InputSource>::Error>

Fetches the transparent output corresponding to the provided outpoint. Allows selecting unspendable outputs for testing purposes. Read more
Source§

fn get_notes( &self, protocol: ShieldedProtocol, ) -> Result<Vec<ReceivedNote<Self::NoteRef, Note>>, <Self as InputSource>::Error>

Returns all the notes that have been received by the wallet.
Source§

impl<C: BorrowMut<Connection>, P: Parameters, CL: Clock, R> WalletWrite for WalletDb<C, P, CL, R>

Source§

type UtxoRef = UtxoId

The type of identifiers used to look up transparent UTXOs.
Source§

fn create_account( &mut self, account_name: &str, seed: &SecretVec<u8>, birthday: &AccountBirthday, key_source: Option<&str>, ) -> Result<(Self::AccountId, UnifiedSpendingKey), Self::Error>

Tells the wallet to track the next available account-level spend authority, given the current set of ZIP 316 account identifiers known to the wallet database. Read more
Source§

fn import_account_hd( &mut self, account_name: &str, seed: &SecretVec<u8>, account_index: AccountId, birthday: &AccountBirthday, key_source: Option<&str>, ) -> Result<(Self::Account, UnifiedSpendingKey), Self::Error>

Tells the wallet to track a specific account index for a given seed. Read more
Source§

fn import_account_ufvk( &mut self, account_name: &str, ufvk: &UnifiedFullViewingKey, birthday: &AccountBirthday, purpose: AccountPurpose, key_source: Option<&str>, ) -> Result<Self::Account, Self::Error>

Tells the wallet to track an account using a unified full viewing key. Read more
Source§

fn get_next_available_address( &mut self, account_uuid: Self::AccountId, request: UnifiedAddressRequest, ) -> Result<Option<(UnifiedAddress, DiversifierIndex)>, Self::Error>

Generates, persists, and marks as exposed the next available diversified address for the specified account, given the current addresses known to the wallet. Read more
Source§

fn get_address_for_index( &mut self, account: Self::AccountId, diversifier_index: DiversifierIndex, request: UnifiedAddressRequest, ) -> Result<Option<UnifiedAddress>, Self::Error>

Generates, persists, and marks as exposed a diversified address for the specified account at the provided diversifier index. Read more
Source§

fn update_chain_tip( &mut self, tip_height: BlockHeight, ) -> Result<(), Self::Error>

Updates the wallet’s view of the blockchain. Read more
Source§

fn put_blocks( &mut self, from_state: &ChainState, blocks: Vec<ScannedBlock<Self::AccountId>>, ) -> Result<(), Self::Error>

Updates the state of the wallet database by persisting the provided block information, along with the note commitments that were detected when scanning the block for transactions pertaining to this wallet. Read more
Source§

fn put_received_transparent_utxo( &mut self, _output: &WalletTransparentOutput, ) -> Result<Self::UtxoRef, Self::Error>

Adds a transparent UTXO received by the wallet to the data store.
Source§

fn store_decrypted_tx( &mut self, d_tx: DecryptedTransaction<'_, Self::AccountId>, ) -> Result<(), Self::Error>

Caches a decrypted transaction in the persistent wallet store.
Source§

fn store_transactions_to_be_sent( &mut self, transactions: &[SentTransaction<'_, Self::AccountId>], ) -> Result<(), Self::Error>

Saves information about transactions constructed by the wallet to the persistent wallet store. Read more
Source§

fn truncate_to_height( &mut self, max_height: BlockHeight, ) -> Result<BlockHeight, Self::Error>

Truncates the wallet database to at most the specified height. Read more
Source§

fn reserve_next_n_ephemeral_addresses( &mut self, account_id: Self::AccountId, n: usize, ) -> Result<Vec<(TransparentAddress, TransparentAddressMetadata)>, Self::Error>

Reserves the next n available ephemeral addresses for the given account. This cannot be undone, so as far as possible, errors associated with transaction construction should have been reported before calling this method. Read more
Source§

fn set_transaction_status( &mut self, txid: TxId, status: TransactionStatus, ) -> Result<(), Self::Error>

Updates the wallet backend with respect to the status of a specific transaction, from the perspective of the main chain. Read more

Auto Trait Implementations§

§

impl<C, P, CL, R> Freeze for WalletDb<C, P, CL, R>
where C: Freeze, P: Freeze, CL: Freeze, R: Freeze,

§

impl<C, P, CL, R> RefUnwindSafe for WalletDb<C, P, CL, R>

§

impl<C, P, CL, R> Send for WalletDb<C, P, CL, R>
where C: Send, P: Send, CL: Send, R: Send,

§

impl<C, P, CL, R> Sync for WalletDb<C, P, CL, R>
where C: Sync, P: Sync, CL: Sync, R: Sync,

§

impl<C, P, CL, R> Unpin for WalletDb<C, P, CL, R>
where C: Unpin, P: Unpin, CL: Unpin, R: Unpin,

§

impl<C, P, CL, R> UnwindSafe for WalletDb<C, P, CL, R>

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
§

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

§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

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