pub struct Chain {
    network: Network,
    inner: ChainInner,
    pub(super) last_fork_height: Option<Height>,
}
Expand description

A single non-finalized partial chain, from the child of the finalized tip, to a non-finalized chain tip.

Fields§

§network: Network

The configured network for this chain.

§inner: ChainInner

The internal state of this chain.

§last_fork_height: Option<Height>

The last height this chain forked at. Diagnostics only.

This field is only used for metrics, it is not consensus-critical, and it is not checked for equality.

We keep the same last fork height in both sides of a clone, because every new block clones a chain, even if it’s just growing that chain.

Implementations§

source§

impl Chain

source

pub(crate) fn new( network: &Network, finalized_tip_height: Height, sprout_note_commitment_tree: Arc<NoteCommitmentTree>, sapling_note_commitment_tree: Arc<NoteCommitmentTree>, orchard_note_commitment_tree: Arc<NoteCommitmentTree>, history_tree: Arc<HistoryTree>, finalized_tip_chain_value_pools: ValueBalance<NonNegative> ) -> Self

Create a new Chain with the given finalized tip trees and network.

source

pub fn eq_internal_state(&self, other: &Chain) -> bool

Is the internal state of self the same as other?

Chain has custom Eq and Ord implementations based on proof of work, which are used to select the best chain. So we can’t derive Eq for Chain.

Unlike the custom trait impls, this method returns true if the entire internal state of two chains is equal.

If the internal states are different, it returns false, even if the blocks in the two chains are equal.

source

pub fn recent_fork_height(&self) -> Option<Height>

Returns the last fork height if that height is still in the non-finalized state. Otherwise, if that fork has been finalized, returns None.

source

pub fn recent_fork_length(&self) -> Option<u32>

Returns this chain fork’s length, if its fork is still in the non-finalized state. Otherwise, if the fork has been finalized, returns None.

source

pub fn push( self, block: ContextuallyVerifiedBlock ) -> Result<Chain, ValidateContextError>

Push a contextually valid non-finalized block into this chain as the new tip.

If the block is invalid, drops this chain, and returns an error.

Note: a ContextuallyVerifiedBlock isn’t actually contextually valid until Self::update_chain_tip_with returns success.

source

pub(crate) fn pop_root(&mut self) -> (ContextuallyVerifiedBlock, Treestate)

Pops the lowest height block of the non-finalized portion of a chain, and returns it with its associated treestate.

source

pub fn non_finalized_root_height(&self) -> Height

Returns the height of the chain root.

source

pub fn fork(&self, fork_tip: Hash) -> Option<Self>

Fork and return a chain at the block with the given fork_tip, if it is part of this chain. Otherwise, if this chain does not contain fork_tip, returns None.

source

pub fn network(&self) -> Network

Returns the Network for this chain.

source

pub fn block( &self, hash_or_height: HashOrHeight ) -> Option<&ContextuallyVerifiedBlock>

Returns the ContextuallyVerifiedBlock with block::Hash or Height, if it exists in this chain.

source

pub fn transaction(&self, hash: Hash) -> Option<(&Arc<Transaction>, Height)>

Returns the Transaction with transaction::Hash, if it exists in this chain.

source

pub fn transaction_by_loc( &self, tx_loc: TransactionLocation ) -> Option<&Arc<Transaction>>

Returns the Transaction at TransactionLocation, if it exists in this chain.

source

pub fn transaction_hash_by_loc( &self, tx_loc: TransactionLocation ) -> Option<&Hash>

Returns the transaction::Hash for the transaction at TransactionLocation, if it exists in this chain.

source

pub fn transaction_hashes_for_block( &self, hash_or_height: HashOrHeight ) -> Option<Arc<[Hash]>>

Returns the transaction::Hashes in the block with hash_or_height, if it exists in this chain.

Hashes are returned in block order.

Returns None if the block is not found.

source

pub fn hash_by_height(&self, height: Height) -> Option<Hash>

Returns the block::Hash for height, if it exists in this chain.

source

pub fn height_by_hash(&self, hash: Hash) -> Option<Height>

Returns the Height for hash, if it exists in this chain.

source

pub fn contains_block_hash(&self, hash: Hash) -> bool

Returns true is the chain contains the given block hash. Returns false otherwise.

source

pub fn contains_block_height(&self, height: Height) -> bool

Returns true is the chain contains the given block height. Returns false otherwise.

source

pub fn contains_hash_or_height( &self, hash_or_height: impl Into<HashOrHeight> ) -> bool

Returns true is the chain contains the given block hash or height. Returns false otherwise.

source

pub fn non_finalized_tip(&self) -> (Height, Hash)

Returns the non-finalized tip block height and hash.

source

pub fn sprout_note_commitment_tree_for_tip(&self) -> Arc<NoteCommitmentTree>

Returns the Sprout note commitment tree of the tip of this Chain, including all finalized notes, and the non-finalized notes in this chain.

If the chain is empty, instead returns the tree of the finalized tip, which was supplied in Chain::new()

§Panics

If this chain has no sprout trees. (This should be impossible.)

source

pub fn sprout_tree( &self, hash_or_height: HashOrHeight ) -> Option<Arc<NoteCommitmentTree>>

Returns the Sprout NoteCommitmentTree specified by a HashOrHeight, if it exists in the non-finalized Chain.

source

fn add_sprout_tree_and_anchor( &mut self, height: Height, tree: Arc<NoteCommitmentTree> )

Adds the Sprout tree to the tree and anchor indexes at height.

height can be either:

  • the height of a new block that has just been added to the chain tip, or
  • the finalized tip height—the height of the parent of the first block of a new chain.

Stores only the first tree in each series of identical trees.

§Panics
  • If there’s a tree already stored at height.
  • If there’s an anchor already stored at height.
source

fn remove_sprout_tree_and_anchor( &mut self, position: RevertPosition, height: Height )

Removes the Sprout tree and anchor indexes at height.

height can be at two different RevertPositions in the chain:

  • a tip block above a chain fork—only the tree and anchor at that height are removed, or

  • a root block—all trees and anchors at and below that height are removed, including temporary finalized tip trees.

    §Panics
  • If the anchor being removed is not present.

  • If there is no tree at height.

source

pub fn sapling_note_commitment_tree_for_tip(&self) -> Arc<NoteCommitmentTree>

Returns the Sapling note commitment tree of the tip of this Chain, including all finalized notes, and the non-finalized notes in this chain.

If the chain is empty, instead returns the tree of the finalized tip, which was supplied in Chain::new()

§Panics

If this chain has no sapling trees. (This should be impossible.)

source

pub fn sapling_tree( &self, hash_or_height: HashOrHeight ) -> Option<Arc<NoteCommitmentTree>>

Returns the Sapling NoteCommitmentTree specified by a HashOrHeight, if it exists in the non-finalized Chain.

source

pub fn sapling_subtree( &self, hash_or_height: HashOrHeight ) -> Option<NoteCommitmentSubtree<Node>>

Returns the Sapling NoteCommitmentSubtree that was completed at a block with HashOrHeight, if it exists in the non-finalized Chain.

§Concurrency

This method should not be used to get subtrees in concurrent code by height, because the same heights in different chain forks can have different subtrees.

source

pub fn sapling_subtrees_in_range( &self, range: impl RangeBounds<NoteCommitmentSubtreeIndex> ) -> BTreeMap<NoteCommitmentSubtreeIndex, NoteCommitmentSubtreeData<Node>>

Returns a list of Sapling NoteCommitmentSubtrees in the provided range.

Unlike the finalized state and ReadRequest::SaplingSubtrees, the returned subtrees can start after start_index. These subtrees are continuous up to the tip.

There is no API for retrieving single subtrees by index, because it can accidentally be used to create an inconsistent list of subtrees after concurrent non-finalized and finalized updates.

source

pub fn sapling_subtree_for_tip(&self) -> Option<NoteCommitmentSubtree<Node>>

Returns the Sapling NoteCommitmentSubtree if it was completed at the tip height.

source

fn add_sapling_tree_and_anchor( &mut self, height: Height, tree: Arc<NoteCommitmentTree> )

Adds the Sapling tree to the tree and anchor indexes at height.

height can be either:

  • the height of a new block that has just been added to the chain tip, or
  • the finalized tip height—the height of the parent of the first block of a new chain.

Stores only the first tree in each series of identical trees.

§Panics
  • If there’s a tree already stored at height.
  • If there’s an anchor already stored at height.
source

fn remove_sapling_tree_and_anchor( &mut self, position: RevertPosition, height: Height )

Removes the Sapling tree and anchor indexes at height.

height can be at two different RevertPositions in the chain:

  • a tip block above a chain fork—only the tree and anchor at that height are removed, or

  • a root block—all trees and anchors at and below that height are removed, including temporary finalized tip trees.

    §Panics
  • If the anchor being removed is not present.

  • If there is no tree at height.

source

pub fn orchard_note_commitment_tree_for_tip(&self) -> Arc<NoteCommitmentTree>

Returns the Orchard note commitment tree of the tip of this Chain, including all finalized notes, and the non-finalized notes in this chain.

If the chain is empty, instead returns the tree of the finalized tip, which was supplied in Chain::new()

§Panics

If this chain has no orchard trees. (This should be impossible.)

source

pub fn orchard_tree( &self, hash_or_height: HashOrHeight ) -> Option<Arc<NoteCommitmentTree>>

Returns the Orchard NoteCommitmentTree specified by a HashOrHeight, if it exists in the non-finalized Chain.

source

pub fn orchard_subtree( &self, hash_or_height: HashOrHeight ) -> Option<NoteCommitmentSubtree<Node>>

Returns the Orchard NoteCommitmentSubtree that was completed at a block with HashOrHeight, if it exists in the non-finalized Chain.

§Concurrency

This method should not be used to get subtrees in concurrent code by height, because the same heights in different chain forks can have different subtrees.

source

pub fn orchard_subtrees_in_range( &self, range: impl RangeBounds<NoteCommitmentSubtreeIndex> ) -> BTreeMap<NoteCommitmentSubtreeIndex, NoteCommitmentSubtreeData<Node>>

Returns a list of Orchard NoteCommitmentSubtrees in the provided range.

Unlike the finalized state and ReadRequest::OrchardSubtrees, the returned subtrees can start after start_index. These subtrees are continuous up to the tip.

There is no API for retrieving single subtrees by index, because it can accidentally be used to create an inconsistent list of subtrees after concurrent non-finalized and finalized updates.

source

pub fn orchard_subtree_for_tip(&self) -> Option<NoteCommitmentSubtree<Node>>

Returns the Orchard NoteCommitmentSubtree if it was completed at the tip height.

source

fn add_orchard_tree_and_anchor( &mut self, height: Height, tree: Arc<NoteCommitmentTree> )

Adds the Orchard tree to the tree and anchor indexes at height.

height can be either:

  • the height of a new block that has just been added to the chain tip, or
  • the finalized tip height—the height of the parent of the first block of a new chain.

Stores only the first tree in each series of identical trees.

§Panics
  • If there’s a tree already stored at height.
  • If there’s an anchor already stored at height.
source

fn remove_orchard_tree_and_anchor( &mut self, position: RevertPosition, height: Height )

Removes the Orchard tree and anchor indexes at height.

height can be at two different RevertPositions in the chain:

  • a tip block above a chain fork—only the tree and anchor at that height are removed, or

  • a root block—all trees and anchors at and below that height are removed, including temporary finalized tip trees.

    §Panics
  • If the anchor being removed is not present.

  • If there is no tree at height.

source

pub fn history_block_commitment_tree(&self) -> Arc<HistoryTree>

Returns the History tree of the tip of this Chain, including all finalized blocks, and the non-finalized blocks below the chain tip.

If the chain is empty, instead returns the tree of the finalized tip, which was supplied in Chain::new()

§Panics

If this chain has no history trees. (This should be impossible.)

source

pub fn history_tree( &self, hash_or_height: HashOrHeight ) -> Option<Arc<HistoryTree>>

Returns the HistoryTree specified by a HashOrHeight, if it exists in the non-finalized Chain.

source

fn add_history_tree(&mut self, height: Height, tree: Arc<HistoryTree>)

Add the History tree to the history tree index at height.

height can be either:

  • the height of a new block that has just been added to the chain tip, or
  • the finalized tip height: the height of the parent of the first block of a new chain.
source

fn remove_history_tree(&mut self, position: RevertPosition, height: Height)

Remove the History tree index at height.

height can be at two different RevertPositions in the chain:

  • a tip block above a chain fork: only that height is removed, or
  • a root block: all trees below that height are removed, including temporary finalized tip trees.
source

fn treestate(&self, hash_or_height: HashOrHeight) -> Option<Treestate>

source

pub fn non_finalized_tip_hash(&self) -> Hash

Returns the block hash of the tip block.

source

pub fn non_finalized_root(&self) -> (Hash, Height)

Returns the non-finalized root block hash and height.

source

pub fn non_finalized_root_hash(&self) -> Hash

Returns the block hash of the non-finalized root block.

source

pub fn non_finalized_nth_hash(&self, n: usize) -> Option<Hash>

Returns the block hash of the nth block from the non-finalized root.

This is the block at non_finalized_root_height() + n.

source

fn pop_tip(&mut self)

Remove the highest height block of the non-finalized portion of a chain.

source

pub fn non_finalized_tip_height(&self) -> Height

Return the non-finalized tip height for this chain.

§Panics

Panics if called while the chain is empty, or while the chain is updating its internal state with the first block.

source

fn max_block_height(&self) -> Option<Height>

Return the non-finalized tip height for this chain, or None if self.blocks is empty.

source

pub fn tip_block(&self) -> Option<&ContextuallyVerifiedBlock>

Return the non-finalized tip block for this chain, or None if self.blocks is empty.

source

pub fn is_empty(&self) -> bool

Returns true if the non-finalized part of this chain is empty.

source

pub fn len(&self) -> usize

Returns the non-finalized length of this chain.

source

pub fn unspent_utxos(&self) -> HashMap<OutPoint, OrderedUtxo>

Returns the unspent transaction outputs (UTXOs) in this non-finalized chain.

Callers should also check the finalized state for available UTXOs. If UTXOs remain unspent when a block is finalized, they are stored in the finalized state, and removed from the relevant chain(s).

source

pub fn created_utxo(&self, outpoint: &OutPoint) -> Option<Utxo>

Returns the transparent::Utxo pointed to by the given transparent::OutPoint if it was created by this chain.

UTXOs are returned regardless of whether they have been spent.

source

pub fn partial_transparent_indexes<'a>( &'a self, addresses: &'a HashSet<Address> ) -> impl Iterator<Item = &TransparentTransfers>

Returns the transparent transfers for addresses in this non-finalized chain.

If none of the addresses have an address index, returns an empty iterator.

§Correctness

Callers should apply the returned indexes to the corresponding finalized state indexes.

The combined result will only be correct if the chains match. The exact type of match varies by query.

source

pub fn partial_transparent_balance_change( &self, addresses: &HashSet<Address> ) -> Amount<NegativeAllowed>

Returns the transparent balance change for addresses in this non-finalized chain.

If the balance doesn’t change for any of the addresses, returns zero.

§Correctness

Callers should apply this balance change to the finalized state balance for addresses.

The total balance will only be correct if this partial chain matches the finalized state. Specifically, the root of this partial chain must be a child block of the finalized tip.

source

pub fn partial_transparent_utxo_changes( &self, addresses: &HashSet<Address> ) -> (BTreeMap<OutputLocation, Output>, BTreeSet<OutputLocation>)

Returns the transparent UTXO changes for addresses in this non-finalized chain.

If the UTXOs don’t change for any of the addresses, returns empty lists.

§Correctness

Callers should apply these non-finalized UTXO changes to the finalized state UTXOs.

The UTXOs will only be correct if the non-finalized chain matches or overlaps with the finalized state.

Specifically, a block in the partial chain must be a child block of the finalized tip. (But the child block does not have to be the partial chain root.)

source

pub fn partial_transparent_tx_ids( &self, addresses: &HashSet<Address>, query_height_range: RangeInclusive<Height> ) -> BTreeMap<TransactionLocation, Hash>

Returns the transaction::Hashes used by addresses to receive or spend funds, in the non-finalized chain, filtered using the query_height_range.

If none of the addresses receive or spend funds in this partial chain, returns an empty list.

§Correctness

Callers should combine these non-finalized transactions with the finalized state transactions.

The transaction IDs will only be correct if the non-finalized chain matches or overlaps with the finalized state.

Specifically, a block in the partial chain must be a child block of the finalized tip. (But the child block does not have to be the partial chain root.)

This condition does not apply if there is only one address. Since address transactions are only appended by blocks, and the finalized state query reads them in order, it is impossible to get inconsistent transactions for a single address.

source

fn update_chain_tip_with_block_parallel( &mut self, contextually_valid: &ContextuallyVerifiedBlock ) -> Result<(), ValidateContextError>

Update the chain tip with the contextually_valid block, running note commitment tree updates in parallel with other updates.

Used to implement update_chain_tip_with::<ContextuallyVerifiedBlock>.

source

fn update_chain_tip_with_block_except_trees( &mut self, contextually_valid: &ContextuallyVerifiedBlock ) -> Result<(), ValidateContextError>

Update the chain tip with the contextually_valid block, except for the note commitment and history tree updates.

Used to implement update_chain_tip_with::<ContextuallyVerifiedBlock>.

Trait Implementations§

source§

impl Clone for Chain

source§

fn clone(&self) -> Chain

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Chain

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Chain

source§

fn default() -> Chain

Returns the “default value” for a type. Read more
source§

impl DerefMut for Chain

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Ord for Chain

source§

fn cmp(&self, other: &Self) -> Ordering

Chain order for the NonFinalizedState’s chain_set.

Chains with higher cumulative Proof of Work are Ordering::Greater, breaking ties using the tip block hash.

Despite the consensus rules, Zebra uses the tip block hash as a tie-breaker. Zebra blocks are downloaded in parallel, so download timestamps may not be unique. (And Zebra currently doesn’t track download times, because Blocks are immutable.)

This departure from the consensus rules may delay network convergence, for as long as the greater hash belongs to the later mined block. But Zebra nodes should converge as soon as the tied work is broken.

“At a given point in time, each full validator is aware of a set of candidate blocks. These form a tree rooted at the genesis block, where each node in the tree refers to its parent via the hashPrevBlock block header field.

A path from the root toward the leaves of the tree consisting of a sequence of one or more valid blocks consistent with consensus rules, is called a valid block chain.

In order to choose the best valid block chain in its view of the overall block tree, a node sums the work … of all blocks in each valid block chain, and considers the valid block chain with greatest total work to be best.

To break ties between leaf blocks, a node will prefer the block that it received first.

The consensus protocol is designed to ensure that for any given block height, the vast majority of nodes should eventually agree on their best valid block chain up to that height.“

https://zips.z.cash/protocol/protocol.pdf#blockchain

§Correctness

Chain::cmp is used in a BTreeSet, so the fields accessed by cmp must not have interior mutability.

§Panics

If two chains compare equal.

This panic enforces the NonFinalizedState::chain_set unique chain invariant.

If the chain set contains duplicate chains, the non-finalized state might handle new blocks or block finalization incorrectly.

1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Chain

source§

fn eq(&self, other: &Self) -> bool

Chain equality for NonFinalizedState::chain_set, using proof of work, then the tip block hash as a tie-breaker.

§Panics

If two chains compare equal.

See Chain::cmp for details.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Chain

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl UpdateWith<(&Vec<Input>, &Hash, &HashMap<OutPoint, OrderedUtxo>)> for Chain

source§

fn update_chain_tip_with( &mut self, (spending_inputs, spending_tx_hash, spent_outputs): &(&Vec<Input>, &Hash, &HashMap<OutPoint, OrderedUtxo>) ) -> Result<(), ValidateContextError>

When T is added to the chain tip, update Chain cumulative data members to add data that are derived from T.
source§

fn revert_chain_with( &mut self, (spending_inputs, spending_tx_hash, spent_outputs): &(&Vec<Input>, &Hash, &HashMap<OutPoint, OrderedUtxo>), position: RevertPosition )

When T is removed from position in the chain, revert Chain cumulative data members to remove data that are derived from T.
source§

impl UpdateWith<(&Vec<Output>, &Hash, &HashMap<OutPoint, OrderedUtxo>)> for Chain

source§

fn update_chain_tip_with( &mut self, (created_outputs, creating_tx_hash, block_created_outputs): &(&Vec<Output>, &Hash, &HashMap<OutPoint, OrderedUtxo>) ) -> Result<(), ValidateContextError>

When T is added to the chain tip, update Chain cumulative data members to add data that are derived from T.
source§

fn revert_chain_with( &mut self, (created_outputs, creating_tx_hash, block_created_outputs): &(&Vec<Output>, &Hash, &HashMap<OutPoint, OrderedUtxo>), position: RevertPosition )

When T is removed from position in the chain, revert Chain cumulative data members to remove data that are derived from T.
source§

impl UpdateWith<ContextuallyVerifiedBlock> for Chain

source§

fn update_chain_tip_with( &mut self, contextually_valid: &ContextuallyVerifiedBlock ) -> Result<(), ValidateContextError>

When T is added to the chain tip, update Chain cumulative data members to add data that are derived from T.
source§

fn revert_chain_with( &mut self, contextually_valid: &ContextuallyVerifiedBlock, position: RevertPosition )

When T is removed from position in the chain, revert Chain cumulative data members to remove data that are derived from T.
source§

impl UpdateWith<Option<JoinSplitData<Groth16Proof>>> for Chain

source§

fn revert_chain_with( &mut self, joinsplit_data: &Option<JoinSplitData<Groth16Proof>>, _position: RevertPosition )

§Panics

Panics if any nullifier is missing from the chain when we try to remove it.

See check::nullifier::remove_from_non_finalized_chain for details.

source§

fn update_chain_tip_with( &mut self, joinsplit_data: &Option<JoinSplitData<Groth16Proof>> ) -> Result<(), ValidateContextError>

When T is added to the chain tip, update Chain cumulative data members to add data that are derived from T.
source§

impl<AnchorV> UpdateWith<Option<ShieldedData<AnchorV>>> for Chain
where AnchorV: AnchorVariant + Clone,

source§

fn revert_chain_with( &mut self, sapling_shielded_data: &Option<ShieldedData<AnchorV>>, _position: RevertPosition )

§Panics

Panics if any nullifier is missing from the chain when we try to remove it.

See check::nullifier::remove_from_non_finalized_chain for details.

source§

fn update_chain_tip_with( &mut self, sapling_shielded_data: &Option<ShieldedData<AnchorV>> ) -> Result<(), ValidateContextError>

When T is added to the chain tip, update Chain cumulative data members to add data that are derived from T.
source§

impl UpdateWith<Option<ShieldedData>> for Chain

source§

fn revert_chain_with( &mut self, orchard_shielded_data: &Option<ShieldedData>, _position: RevertPosition )

§Panics

Panics if any nullifier is missing from the chain when we try to remove it.

See check::nullifier::remove_from_non_finalized_chain for details.

source§

fn update_chain_tip_with( &mut self, orchard_shielded_data: &Option<ShieldedData> ) -> Result<(), ValidateContextError>

When T is added to the chain tip, update Chain cumulative data members to add data that are derived from T.
source§

impl UpdateWith<ValueBalance<NegativeAllowed>> for Chain

source§

fn revert_chain_with( &mut self, block_value_pool_change: &ValueBalance<NegativeAllowed>, position: RevertPosition )

Revert the chain state using a block chain value pool change.

When forking from the tip, subtract the block’s chain value pool change.

When finalizing the root, leave the chain value pool balances unchanged. ChainInner::chain_value_pools tracks the chain value pools for all finalized blocks, and the non-finalized blocks in this chain. So finalizing the root doesn’t change the set of blocks it tracks.

§Panics

Panics if the chain pool value balance is invalid after we subtract the block value pool change.

source§

fn update_chain_tip_with( &mut self, block_value_pool_change: &ValueBalance<NegativeAllowed> ) -> Result<(), ValidateContextError>

When T is added to the chain tip, update Chain cumulative data members to add data that are derived from T.
source§

impl Deref for Chain

§

type Target = ChainInner

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Eq for Chain

Auto Trait Implementations§

§

impl Freeze for Chain

§

impl RefUnwindSafe for Chain

§

impl Send for Chain

§

impl Sync for Chain

§

impl Unpin for Chain

§

impl UnwindSafe for Chain

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
source§

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

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

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

§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

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<Response, Error> ResponseResult<Response, Error> for Response

source§

fn into_result(self) -> Result<Response, Error>

Converts the type into a Result that can be sent as a response.
source§

impl<T> Same for T

§

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

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

§

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
§

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

§

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

§

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