pub struct NonFinalizedState {
chain_set: BTreeSet<Arc<Chain>>,
invalidated_blocks: IndexMap<Height, Arc<Vec<ContextuallyVerifiedBlock>>>,
pub(crate) precomputed_trees: Option<PrecomputedTrees>,
prepared_chain: Sender<Option<Arc<Chain>>>,
pub network: Network,
max_index_entries: Option<usize>,
evicted_block_hashes: Vec<Hash>,
should_count_metrics: bool,
chain_count_bar: Option<Tx>,
chain_fork_length_bars: Vec<Tx>,
}Expand description
The state of the chains in memory, including queued blocks.
Clones of the non-finalized state contain independent copies of the chains.
This is different from FinalizedState::clone(),
which returns a shared reference to the database.
Most chain data is clone-on-write using Arc.
Fields§
§chain_set: BTreeSet<Arc<Chain>>Verified, non-finalized chains, in ascending work order.
The best chain is NonFinalizedState::best_chain(), or chain_iter().next().
Using chain_set.last() or chain_set.iter().next_back() is deprecated,
callers should migrate to chain_iter().next().
invalidated_blocks: IndexMap<Height, Arc<Vec<ContextuallyVerifiedBlock>>>Blocks that have been invalidated in, and removed from, the non finalized state.
precomputed_trees: Option<PrecomputedTrees>Note commitment trees that were computed before the commit of the block they belong to.
The block write task sets this for one commit. Clones never carry it.
prepared_chain: Sender<Option<Arc<Chain>>>A private copy of the best chain with the latest validated block proposal on top.
Proposal validation runs on a clone of this state, and leaves the chain it built here. A commit of the solved proposal rebinds that chain’s tip to the solved block, instead of applying the block to its parent chain again. Clones share this channel, and only nodes that validate proposals keep a chain in it.
network: NetworkThe configured Zcash network.
max_index_entries: Option<usize>The maximum Self::index_entry_count of all chains, if any.
evicted_block_hashes: Vec<Hash>Blocks that were only in evicted chains, and haven’t been taken by
Self::take_evicted_block_hashes yet.
should_count_metrics: boolConfigures the non-finalized state to count metrics.
Used for skipping metrics and progress bars when testing block proposals with a commit to a cloned non-finalized state.
chain_count_bar: Option<Tx>Number of chain forks transmitter.
chain_fork_length_bars: Vec<Tx>A chain fork length transmitter for each Chain in chain_set.
Because chain_set contains Arc<Chain>s, it is difficult to update the metrics state
on each chain. (Arcs are read-only, and we don’t want to clone them just for metrics.)
Implementations§
Source§impl NonFinalizedState
impl NonFinalizedState
Sourcepub fn new(network: &Network) -> NonFinalizedState
pub fn new(network: &Network) -> NonFinalizedState
Returns a new non-finalized state for network.
Sourcepub(crate) fn write_to_backup(&self, backup_dir_path: &Path)
pub(crate) fn write_to_backup(&self, backup_dir_path: &Path)
Writes the current non-finalized state to the backup directory at backup_dir_path.
Reads the existing backup directory contents, writes any blocks that are in the non-finalized state but missing from the backup, and deletes any backup files that are no longer present in the non-finalized state.
This method performs blocking I/O and should only be called from a blocking context.
Sourcepub async fn with_backup(
self,
backup_dir_path: Option<PathBuf>,
finalized_state: &ZebraDb,
should_restore_backup: bool,
skip_backup_task: bool,
) -> (Self, Sender<NonFinalizedState>, WatchReceiver<NonFinalizedState>)
pub async fn with_backup( self, backup_dir_path: Option<PathBuf>, finalized_state: &ZebraDb, should_restore_backup: bool, skip_backup_task: bool, ) -> (Self, Sender<NonFinalizedState>, WatchReceiver<NonFinalizedState>)
Accepts an optional path to the non-finalized state backup directory and a handle to the database.
If a backup directory path is provided:
- Creates a new backup directory at the provided path if none exists,
- Restores non-finalized blocks from the backup directory, if any, and
- Unless
skip_backup_taskis true, spawns a task that updates the non-finalized backup cache with the latest non-finalized state sent to the returned watch channel.
Returns the non-finalized state with a watch channel sender and receiver.
Sourcepub fn eq_internal_state(&self, other: &NonFinalizedState) -> bool
pub fn eq_internal_state(&self, other: &NonFinalizedState) -> bool
Is the internal state of self the same as other?
Chain has a custom Eq implementation based on proof of work,
which is used to select the best chain. So we can’t derive Eq for NonFinalizedState.
Unlike the custom trait impl, this method returns true if the entire internal state
of two non-finalized states is equal.
If the internal states are different, it returns false,
even if the chains and blocks are equal.
Sourcepub fn chain_iter(&self) -> impl Iterator<Item = &Arc<Chain>>
pub fn chain_iter(&self) -> impl Iterator<Item = &Arc<Chain>>
Returns an iterator over the non-finalized chains, with the best chain first.
Sourcefn insert_with<F>(&mut self, chain: Arc<Chain>, chain_filter: F)
fn insert_with<F>(&mut self, chain: Arc<Chain>, chain_filter: F)
Insert chain into self.chain_set, apply chain_filter to the chains,
then limit the number of tracked chains and the size of their indexes.
Sourcepub(crate) fn take_evicted_block_hashes(&mut self) -> Vec<Hash>
pub(crate) fn take_evicted_block_hashes(&mut self) -> Vec<Hash>
Returns the hashes of blocks that were dropped from the non-finalized state because every chain containing them was evicted by the fork limits, and forgets them.
The network can still extend those blocks, so the state service must be able to download and commit them again (#11133).
Sourcefn insert(&mut self, chain: Arc<Chain>)
fn insert(&mut self, chain: Arc<Chain>)
Insert chain into self.chain_set, then limit the number of tracked chains.
Sourcepub(crate) fn should_finalize_root(&self) -> bool
pub(crate) fn should_finalize_root(&self) -> bool
Returns true if the best chain’s root block should be finalized: when the best chain is
longer than the reorg limit, or when the chains pass the index entry limit and the best
chain is longer than MIN_NON_FINALIZED_BLOCKS_OVER_INDEX_LIMIT.
Sourcepub fn finalize(&mut self) -> FinalizableBlock
pub fn finalize(&mut self) -> FinalizableBlock
Finalize the lowest height block in the non-finalized portion of the best chain and update all side-chains to match.
Sourcepub fn commit_block(
&mut self,
prepared: SemanticallyVerifiedBlock,
finalized_state: &ZebraDb,
) -> Result<(), ValidateContextError>
pub fn commit_block( &mut self, prepared: SemanticallyVerifiedBlock, finalized_state: &ZebraDb, ) -> Result<(), ValidateContextError>
Commit block to the non-finalized state, on top of:
- an existing chain’s tip, or
- a newly forked chain.
Sourcepub fn invalidate_block(
&mut self,
block_hash: Hash,
) -> Result<Hash, InvalidateError>
pub fn invalidate_block( &mut self, block_hash: Hash, ) -> Result<Hash, InvalidateError>
Invalidate block with hash block_hash and all descendants from the non-finalized state. Insert
the new chain into the chain_set and discard the previous.
Returns an error without modifying the state if the block is the root of the only chain.
Sourcepub fn reconsider_block(
&mut self,
block_hash: Hash,
finalized_state: &ZebraDb,
) -> Result<Vec<Hash>, ReconsiderError>
pub fn reconsider_block( &mut self, block_hash: Hash, finalized_state: &ZebraDb, ) -> Result<Vec<Hash>, ReconsiderError>
Reconsiders a previously invalidated block and its descendants into the non-finalized state based on a block_hash. Reconsidered blocks are inserted into the previous chain and re-inserted into the chain_set.
Sourcepub fn commit_new_chain(
&mut self,
prepared: SemanticallyVerifiedBlock,
finalized_state: &ZebraDb,
) -> Result<(), ValidateContextError>
pub fn commit_new_chain( &mut self, prepared: SemanticallyVerifiedBlock, finalized_state: &ZebraDb, ) -> Result<(), ValidateContextError>
Commit block to the non-finalized state as a new chain where its parent is the finalized tip.
Sourcepub(crate) fn commit_prevalidated_contextual(
&mut self,
contextual: ContextuallyVerifiedBlock,
finalized_state: &ZebraDb,
) -> Result<Option<Arc<ContextuallyVerifiedBlock>>, ValidateContextError>
pub(crate) fn commit_prevalidated_contextual( &mut self, contextual: ContextuallyVerifiedBlock, finalized_state: &ZebraDb, ) -> Result<Option<Arc<ContextuallyVerifiedBlock>>, ValidateContextError>
Commits contextual, a block that was validated as a block proposal on its parent, and
then solved, without repeating its contextual validation.
If the chain that the proposal’s validation built is still available, this rebinds its tip to the solved block. Otherwise, it applies the block to its parent chain.
Returns the proposal’s block if the solved block replaced it, so the caller can drop it after answering the commit.
Sourcepub(crate) fn store_prepared_chain(&self, chain: Arc<Chain>)
pub(crate) fn store_prepared_chain(&self, chain: Arc<Chain>)
Stores chain, which has a validated block proposal at its tip, for the commit of the
solved proposal. Replaces the chain of any earlier proposal.
Sourcepub(crate) fn drop_passed_prepared_chain(&self)
pub(crate) fn drop_passed_prepared_chain(&self)
Drops the prepared chain once the best chain is longer than it.
A block that solved its proposal now wouldn’t extend the best chain, and nothing else replaces a prepared chain on a node that has stopped validating proposals. The block write task calls this after its commits. Proposal validation runs on a copy of the non-finalized state, and doesn’t.
Sourcefn take_prepared_chain_for(
&self,
block: &ContextuallyVerifiedBlock,
parent_chain: &Chain,
) -> Option<Chain>
fn take_prepared_chain_for( &self, block: &ContextuallyVerifiedBlock, parent_chain: &Chain, ) -> Option<Chain>
Takes the prepared chain, if it is parent_chain with a proposal for block on top.
The returned chain has the same blocks as parent_chain below its tip. Another prepared
chain is left for the commit of its own proposal.
Sourcepub(crate) fn remove_chain_with_tip(&mut self, tip: Hash) -> Option<Arc<Chain>>
pub(crate) fn remove_chain_with_tip(&mut self, tip: Hash) -> Option<Arc<Chain>>
Removes and returns the chain whose tip block is tip, if there is one.
Sourcefn validate_and_commit(
&self,
new_chain: Arc<Chain>,
prepared: SemanticallyVerifiedBlock,
finalized_state: &ZebraDb,
) -> Result<Arc<Chain>, ValidateContextError>
fn validate_and_commit( &self, new_chain: Arc<Chain>, prepared: SemanticallyVerifiedBlock, finalized_state: &ZebraDb, ) -> Result<Arc<Chain>, ValidateContextError>
Contextually validate prepared using finalized_state.
If validation succeeds, push prepared onto new_chain.
new_chain should start as a clone of the parent chain fork,
or the finalized tip.
Sourcefn validate_and_update_parallel(
new_chain: Arc<Chain>,
contextual: ContextuallyVerifiedBlock,
sprout_final_treestates: HashMap<Root, Arc<NoteCommitmentTree>>,
precomputed_trees: Option<&PrecomputedTrees>,
) -> Result<Arc<Chain>, ValidateContextError>
fn validate_and_update_parallel( new_chain: Arc<Chain>, contextual: ContextuallyVerifiedBlock, sprout_final_treestates: HashMap<Root, Arc<NoteCommitmentTree>>, precomputed_trees: Option<&PrecomputedTrees>, ) -> Result<Arc<Chain>, ValidateContextError>
Validate contextual and update new_chain, doing CPU-intensive work in parallel batches.
Sourcepub fn best_chain_len(&self) -> Option<u32>
pub fn best_chain_len(&self) -> Option<u32>
Returns the length of the non-finalized portion of the current best chain
or None if the best chain has no blocks.
Sourcepub fn root_height(&self) -> Option<Height>
pub fn root_height(&self) -> Option<Height>
Returns the root height of the non-finalized state, if the non-finalized state is not empty.
Sourcepub(crate) fn index_entry_count(&self) -> usize
pub(crate) fn index_entry_count(&self) -> usize
Returns the index entries in all chains, counting the entries of blocks that chains share once, and the entries that chains have stopped sharing.
Sourcepub fn any_chain_contains(&self, hash: &Hash) -> bool
pub fn any_chain_contains(&self, hash: &Hash) -> bool
Returns true if hash is contained in the non-finalized portion of any
known chain.
Sourcepub fn find_chain<P>(&self, predicate: P) -> Option<Arc<Chain>>
pub fn find_chain<P>(&self, predicate: P) -> Option<Arc<Chain>>
Returns the first chain satisfying the given predicate.
If multiple chains satisfy the predicate, returns the chain with the highest difficulty. (Using the first-received, then tip block hash tie-breakers.)
Sourcepub fn any_utxo(&self, outpoint: &OutPoint) -> Option<Utxo>
pub fn any_utxo(&self, outpoint: &OutPoint) -> Option<Utxo>
Returns the transparent::Utxo pointed to by the given
transparent::OutPoint if it is present in any chain.
UTXOs are returned regardless of whether they have been spent.
Sourcepub fn any_block_by_hash(&self, hash: Hash) -> Option<Arc<Block>>
pub fn any_block_by_hash(&self, hash: Hash) -> Option<Arc<Block>>
Returns the block with the given hash in any chain.
Sourcepub fn any_prev_block_hash_for_hash(&self, hash: Hash) -> Option<Hash>
pub fn any_prev_block_hash_for_hash(&self, hash: Hash) -> Option<Hash>
Returns the previous block hash for the given block hash in any chain.
Sourcepub fn best_hash(&self, height: Height) -> Option<Hash>
pub fn best_hash(&self, height: Height) -> Option<Hash>
Returns the hash for a given block::Height if it is present in the best chain.
Sourcepub fn best_tip_block(&self) -> Option<&ContextuallyVerifiedBlock>
pub fn best_tip_block(&self) -> Option<&ContextuallyVerifiedBlock>
Returns the block at the tip of the best chain.
Sourcepub fn best_height_by_hash(&self, hash: Hash) -> Option<Height>
pub fn best_height_by_hash(&self, hash: Hash) -> Option<Height>
Returns the height of hash in the best chain.
Sourcepub fn any_height_by_hash(&self, hash: Hash) -> Option<Height>
pub fn any_height_by_hash(&self, hash: Hash) -> Option<Height>
Returns the height of hash in any chain.
Sourcepub fn best_contains_sprout_nullifier(
&self,
sprout_nullifier: &Nullifier,
) -> bool
pub fn best_contains_sprout_nullifier( &self, sprout_nullifier: &Nullifier, ) -> bool
Returns true if the best chain contains sprout_nullifier.
Sourcepub fn best_contains_sapling_nullifier(
&self,
sapling_nullifier: &Nullifier,
) -> bool
pub fn best_contains_sapling_nullifier( &self, sapling_nullifier: &Nullifier, ) -> bool
Returns true if the best chain contains sapling_nullifier.
Sourcepub fn best_contains_orchard_nullifier(
&self,
orchard_nullifier: &Nullifier,
) -> bool
pub fn best_contains_orchard_nullifier( &self, orchard_nullifier: &Nullifier, ) -> bool
Returns true if the best chain contains orchard_nullifier.
Sourcepub fn best_chain(&self) -> Option<&Arc<Chain>>
pub fn best_chain(&self) -> Option<&Arc<Chain>>
Return the non-finalized portion of the current best chain.
Sourcepub fn chain_count(&self) -> usize
pub fn chain_count(&self) -> usize
Return the number of chains.
Sourcepub fn is_chain_set_empty(&self) -> bool
pub fn is_chain_set_empty(&self) -> bool
Returns true if this NonFinalizedState contains no chains.
Sourcepub fn invalidated_blocks(
&self,
) -> IndexMap<Height, Arc<Vec<ContextuallyVerifiedBlock>>>
pub fn invalidated_blocks( &self, ) -> IndexMap<Height, Arc<Vec<ContextuallyVerifiedBlock>>>
Return the invalidated blocks.
Sourcefn parent_chain(
&self,
parent_hash: Hash,
) -> Result<Arc<Chain>, ValidateContextError>
fn parent_chain( &self, parent_hash: Hash, ) -> Result<Arc<Chain>, ValidateContextError>
Return the chain whose tip block hash is parent_hash.
The chain can be an existing chain in the non-finalized state, or a freshly created fork.
Sourcefn should_count_metrics(&self) -> bool
fn should_count_metrics(&self) -> bool
Should this NonFinalizedState instance track metrics and progress bars?
Sourcefn update_metrics_for_committed_block(&self, height: Height, hash: Hash)
fn update_metrics_for_committed_block(&self, height: Height, hash: Hash)
Update the metrics after block is committed
Sourcefn update_metrics_for_chains(&self)
fn update_metrics_for_chains(&self)
Update the metrics after self.chain_set is modified
Sourcefn update_metrics_bars(&mut self)
fn update_metrics_bars(&mut self)
Update the progress bars after any chain is modified. This includes both chain forks and committed blocks.
Sourcepub fn disable_metrics(&mut self)
pub fn disable_metrics(&mut self)
Stop tracking metrics for this non-finalized state and all its chains.
Trait Implementations§
Source§impl Clone for NonFinalizedState
impl Clone for NonFinalizedState
Source§impl Debug for NonFinalizedState
impl Debug for NonFinalizedState
Source§impl Drop for NonFinalizedState
impl Drop for NonFinalizedState
Auto Trait Implementations§
impl !RefUnwindSafe for NonFinalizedState
impl !UnwindSafe for NonFinalizedState
impl Freeze for NonFinalizedState
impl Send for NonFinalizedState
impl Sync for NonFinalizedState
impl Unpin for NonFinalizedState
impl UnsafeUnpin for NonFinalizedState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreimpl<T> MaybeSendSync for T
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
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,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
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>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
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) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
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
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Response, Error> ResponseResult<Response, Error> for Response
impl<Response, Error> ResponseResult<Response, Error> for Response
Source§fn into_result(self) -> Result<Response, Error>
fn into_result(self) -> Result<Response, Error>
Result that can be sent as a response.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 560 bytes