pub struct Storage {
verified: VerifiedSet,
pub(super) pending_outputs: PendingOutputs,
tip_rejected_exact: HashMap<UnminedTxId, ExactTipRejectionError>,
tip_rejected_same_effects: HashMap<Hash, SameEffectsTipRejectionError>,
chain_rejected_same_effects: HashMap<SameEffectsChainRejectionError, EvictionList>,
eviction_memory_time: Duration,
tx_cost_limit: u64,
}
Expand description
Hold mempool verified and rejected mempool transactions.
Fields§
§verified: VerifiedSet
The set of verified transactions in the mempool.
pending_outputs: PendingOutputs
The set of outpoints with pending requests for their associated transparent::Output.
tip_rejected_exact: HashMap<UnminedTxId, ExactTipRejectionError>
The set of transactions rejected due to bad authorizations, or for other reasons, and their rejection reasons. These rejections only apply to the current tip.
Only transactions with the exact UnminedTxId
are invalid.
tip_rejected_same_effects: HashMap<Hash, SameEffectsTipRejectionError>
A set of transactions rejected for their effects, and their rejection reasons. These rejections only apply to the current tip.
Any transaction with the same transaction::Hash
is invalid.
chain_rejected_same_effects: HashMap<SameEffectsChainRejectionError, EvictionList>
Sets of transactions rejected for their effects, keyed by rejection reason. These rejections apply until a rollback or network upgrade.
Any transaction with the same transaction::Hash
is invalid.
An EvictionList
is used for both randomly evicted and expired
transactions, even if it is only needed for the evicted ones. This was
done just to simplify the existing code; there is no harm in having a
timeout for expired transactions too since re-checking expired
transactions is cheap.
eviction_memory_time: Duration
The mempool transaction eviction age limit.
Same as config::Config::eviction_memory_time
.
tx_cost_limit: u64
Max total cost of the verified mempool set, beyond which transactions are evicted to make room.
Implementations§
source§impl Storage
impl Storage
pub(crate) fn new(config: &Config) -> Self
sourcepub fn insert(
&mut self,
tx: VerifiedUnminedTx,
spent_mempool_outpoints: Vec<OutPoint>,
) -> Result<UnminedTxId, MempoolError>
pub fn insert( &mut self, tx: VerifiedUnminedTx, spent_mempool_outpoints: Vec<OutPoint>, ) -> Result<UnminedTxId, MempoolError>
Insert a VerifiedUnminedTx
into the mempool, caching any rejections.
Accepts the VerifiedUnminedTx
being inserted and spent_mempool_outpoints
,
a list of transparent inputs of the provided VerifiedUnminedTx
that were found
as newly created transparent outputs in the mempool during transaction verification.
Returns an error if the mempool’s verified transactions or rejection caches prevent this transaction from being inserted. These errors should not be propagated to peers, because the transactions are valid.
If inserting this transaction evicts other transactions, they will be tracked
as SameEffectsChainRejectionError::RandomlyEvicted
.
sourcepub fn remove_exact(&mut self, exact_wtxids: &HashSet<UnminedTxId>) -> usize
pub fn remove_exact(&mut self, exact_wtxids: &HashSet<UnminedTxId>) -> usize
Remove transactions from the mempool via exact UnminedTxId
.
For v5 transactions, transactions are matched by WTXID, using both the:
- non-malleable transaction ID, and
- authorizing data hash.
This matches the exact transaction, with identical blockchain effects, signatures, and proofs.
Returns the number of transactions which were removed.
Removes from the ‘verified’ set, if present. Maintains the order in which the other unmined transactions have been inserted into the mempool.
Does not add or remove from the ‘rejected’ tracking set.
sourcepub fn clear_mined_dependencies(&mut self, mined_ids: &HashSet<Hash>)
pub fn clear_mined_dependencies(&mut self, mined_ids: &HashSet<Hash>)
Clears a list of mined transaction ids from the verified set’s tracked transaction dependencies.
sourcepub fn reject_and_remove_same_effects(
&mut self,
mined_ids: &HashSet<Hash>,
transactions: Vec<Arc<Transaction>>,
) -> usize
pub fn reject_and_remove_same_effects( &mut self, mined_ids: &HashSet<Hash>, transactions: Vec<Arc<Transaction>>, ) -> usize
Reject and remove transactions from the mempool via non-malleable transaction::Hash
.
- For v5 transactions, transactions are matched by TXID, using only the non-malleable transaction ID. This matches any transaction with the same effect on the blockchain state, even if its signatures and proofs are different.
- Returns the number of transactions which were removed.
- Removes from the ‘verified’ set, if present. Maintains the order in which the other unmined transactions have been inserted into the mempool.
- Prunes
pending_outputs
of any closed channels.
Reject and remove transactions from the mempool that contain any spent outpoints or revealed
nullifiers from the passed in transactions
.
Returns the number of transactions that were removed.
sourcepub fn clear_tip_rejections(&mut self)
pub fn clear_tip_rejections(&mut self)
Clears rejections that only apply to the current tip.
sourcefn limit_rejection_list_memory(&mut self)
fn limit_rejection_list_memory(&mut self)
Clears rejections that only apply to the current tip.
§Security
This method must be called at the end of every method that adds rejections. Otherwise, peers could make our reject lists use a lot of RAM.
sourcepub fn tx_ids(&self) -> impl Iterator<Item = UnminedTxId> + '_
pub fn tx_ids(&self) -> impl Iterator<Item = UnminedTxId> + '_
Returns the set of UnminedTxId
s in the mempool.
sourcepub fn transactions(&self) -> &HashMap<Hash, VerifiedUnminedTx>
pub fn transactions(&self) -> &HashMap<Hash, VerifiedUnminedTx>
Returns a reference to the HashMap
of VerifiedUnminedTx
s in the verified set.
Each VerifiedUnminedTx
contains an UnminedTx
,
and adds extra fields from the transaction verifier result.
sourcepub fn transaction_dependencies(&self) -> &TransactionDependencies
pub fn transaction_dependencies(&self) -> &TransactionDependencies
Returns a reference to the TransactionDependencies
in the verified set.
sourcepub fn created_output(&self, outpoint: &OutPoint) -> Option<Output>
pub fn created_output(&self, outpoint: &OutPoint) -> Option<Output>
Returns a transparent::Output
created by a mempool transaction for the provided
transparent::OutPoint
if one exists, or None otherwise.
sourcepub fn transaction_count(&self) -> usize
pub fn transaction_count(&self) -> usize
Returns the number of transactions in the mempool.
sourcepub fn total_cost(&self) -> u64
pub fn total_cost(&self) -> u64
Returns the cost of the transactions in the mempool, according to ZIP-401.
sourcepub fn total_serialized_size(&self) -> usize
pub fn total_serialized_size(&self) -> usize
Returns the total serialized size of the verified transactions in the set.
See VerifiedSet::total_serialized_size()
for details.
sourcepub fn transactions_exact(
&self,
tx_ids: HashSet<UnminedTxId>,
) -> impl Iterator<Item = &UnminedTx>
pub fn transactions_exact( &self, tx_ids: HashSet<UnminedTxId>, ) -> impl Iterator<Item = &UnminedTx>
Returns the set of UnminedTx
es with exactly matching tx_ids
in the
mempool.
This matches the exact transaction, with identical blockchain effects, signatures, and proofs.
sourcepub fn transactions_same_effects(
&self,
tx_ids: HashSet<Hash>,
) -> impl Iterator<Item = &UnminedTx>
pub fn transactions_same_effects( &self, tx_ids: HashSet<Hash>, ) -> impl Iterator<Item = &UnminedTx>
Returns the set of UnminedTx
es with matching transaction::Hash
es
in the mempool.
This matches transactions with the same effects, regardless of
transaction::AuthDigest
.
sourcepub fn contains_transaction_exact(&self, tx_id: &Hash) -> bool
pub fn contains_transaction_exact(&self, tx_id: &Hash) -> bool
Returns true
if a transaction exactly matching an UnminedTxId
is in
the mempool.
This matches the exact transaction, with identical blockchain effects, signatures, and proofs.
sourcepub fn rejected_transaction_count(&mut self) -> usize
pub fn rejected_transaction_count(&mut self) -> usize
Returns the number of rejected UnminedTxId
s or transaction::Hash
es.
Transactions on multiple rejected lists are counted multiple times.
sourcepub fn reject(&mut self, tx_id: UnminedTxId, reason: RejectionError)
pub fn reject(&mut self, tx_id: UnminedTxId, reason: RejectionError)
Add a transaction to the rejected list for the given reason.
sourcepub fn rejection_error(&self, txid: &UnminedTxId) -> Option<MempoolError>
pub fn rejection_error(&self, txid: &UnminedTxId) -> Option<MempoolError>
Returns the rejection error if a transaction matching an UnminedTxId
is in any mempool rejected list.
This matches transactions based on each rejection list’s matching rule.
Returns an arbitrary error if the transaction is in multiple lists.
sourcepub fn rejected_transactions(
&self,
tx_ids: HashSet<UnminedTxId>,
) -> impl Iterator<Item = UnminedTxId> + '_
pub fn rejected_transactions( &self, tx_ids: HashSet<UnminedTxId>, ) -> impl Iterator<Item = UnminedTxId> + '_
Returns the set of UnminedTxId
s matching tx_ids
in the rejected list.
This matches transactions based on each rejection list’s matching rule.
sourcepub fn contains_rejected(&self, txid: &UnminedTxId) -> bool
pub fn contains_rejected(&self, txid: &UnminedTxId) -> bool
Returns true
if a transaction matching the supplied UnminedTxId
is in
the mempool rejected list.
This matches transactions based on each rejection list’s matching rule.
sourcepub fn reject_if_needed(
&mut self,
tx_id: UnminedTxId,
e: TransactionDownloadVerifyError,
)
pub fn reject_if_needed( &mut self, tx_id: UnminedTxId, e: TransactionDownloadVerifyError, )
Add a transaction that failed download and verification to the rejected list if needed, depending on the reason for the failure.
sourcepub fn remove_expired_transactions(
&mut self,
tip_height: Height,
) -> HashSet<Hash>
pub fn remove_expired_transactions( &mut self, tip_height: Height, ) -> HashSet<Hash>
Remove transactions from the mempool if they have not been mined after a specified height, per ZIP-203.
Transactions will have a new field, nExpiryHeight, which will set the block height after which transactions will be removed from the mempool if they have not been mined.
sourcepub fn should_download_or_verify(
&mut self,
txid: UnminedTxId,
) -> Result<(), MempoolError>
pub fn should_download_or_verify( &mut self, txid: UnminedTxId, ) -> Result<(), MempoolError>
Check if transaction should be downloaded and/or verified.
If it is already in the mempool (or in its rejected list) then it shouldn’t be downloaded/verified.
sourcefn update_rejected_metrics(&mut self)
fn update_rejected_metrics(&mut self)
Update metrics related to the rejected lists.
Must be called every time the rejected lists change.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Storage
impl !RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl !UnwindSafe for Storage
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
§impl<T> Conv for T
impl<T> Conv for T
§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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§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_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, 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<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
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.