pub struct Shell<D = PersistentDB, H = Sha256Hasher>{
pub chain_id: ChainId,
pub state: FullAccessState<D, H>,
pub vp_wasm_cache: VpCache<WasmCacheRwAccess>,
pub tx_wasm_cache: TxCache<WasmCacheRwAccess>,
pub scheduled_migration: Option<ScheduledMigration>,
pub blocks_between_snapshots: Option<NonZeroU64>,
pub syncing: Option<SnapshotSync>,
/* private fields */
}Fields§
§chain_id: ChainIdThe id of the current chain
state: FullAccessState<D, H>The persistent storage with write log
vp_wasm_cache: VpCache<WasmCacheRwAccess>VP WASM compilation cache
tx_wasm_cache: TxCache<WasmCacheRwAccess>Tx WASM compilation cache
scheduled_migration: Option<ScheduledMigration>A migration that can be scheduled at a given block height
blocks_between_snapshots: Option<NonZeroU64>When set, indicates after how many blocks a new snapshot will be taken (counting from the first block)
syncing: Option<SnapshotSync>Data for a node downloading and apply snapshots as part of the fast sync protocol.
Implementations§
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn finalize_block(
&mut self,
req: FinalizeBlock,
) -> ShellResult<FinalizeBlock>
pub fn finalize_block( &mut self, req: FinalizeBlock, ) -> ShellResult<FinalizeBlock>
Updates the chain with new header, height, etc. Also keeps track of epoch changes and applies associated updates to validator sets, etc. as necessary.
Apply the transactions included in the block.
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn init_chain(&mut self, init: InitChain) -> ShellResult<InitChain>
pub fn init_chain(&mut self, init: InitChain) -> ShellResult<InitChain>
Create a new genesis for the chain with specified id. This includes
- A set of initial users and tokens
- Setting up the validity predicates for both users and tokens
- Validators
- The PoS system
- The Ethereum bridge parameters
INVARIANT: This method must not commit the state changes to DB.
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn prepare_proposal(&self, req: RequestPrepareProposal) -> PrepareProposal
pub fn prepare_proposal(&self, req: RequestPrepareProposal) -> PrepareProposal
Begin a new block.
Block construction is documented in block_alloc
and block_alloc::states (private modules).
INVARIANT: Any changes applied in this method must be reverted if the proposal is rejected (unless we can simply overwrite them in the next block). Furthermore, protocol transactions cannot affect the ability of a tx to pay its wrapper fees.
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn verify_header(&self, _req: VerifyHeader) -> VerifyHeader
pub fn verify_header(&self, _req: VerifyHeader) -> VerifyHeader
INVARIANT: This method must be stateless.
Sourcepub fn process_proposal(
&self,
req: RequestProcessProposal,
) -> (ProcessProposal, Vec<TxResult>)
pub fn process_proposal( &self, req: RequestProcessProposal, ) -> (ProcessProposal, Vec<TxResult>)
Check all the txs in a block. Some txs may be incorrect, but we only reject the entire block if the order of the included txs violates the order decided upon in the previous block.
Sourcepub fn process_txs(
&self,
txs: &[TxBytes],
block_time: DateTimeUtc,
block_proposer: &Address,
) -> Vec<TxResult>
pub fn process_txs( &self, txs: &[TxBytes], block_time: DateTimeUtc, block_proposer: &Address, ) -> Vec<TxResult>
Evaluates the corresponding TxResult for each tx in the
proposal.
ProcessProposal should be able to make a decision on whether a
proposed block is acceptable or not based solely on what this
function returns.
Sourcepub fn check_proposal_tx<CA>(
&self,
tx_bytes: &[u8],
tx_index: &TxIndex,
metadata: &mut ValidationMeta,
temp_state: &mut TempWlState<'static, D, H>,
block_time: DateTimeUtc,
vp_wasm_cache: &mut VpCache<CA>,
tx_wasm_cache: &mut TxCache<CA>,
block_proposer: &Address,
) -> TxResultwhere
CA: 'static + WasmCacheAccess + Sync,
pub fn check_proposal_tx<CA>(
&self,
tx_bytes: &[u8],
tx_index: &TxIndex,
metadata: &mut ValidationMeta,
temp_state: &mut TempWlState<'static, D, H>,
block_time: DateTimeUtc,
vp_wasm_cache: &mut VpCache<CA>,
tx_wasm_cache: &mut TxCache<CA>,
block_proposer: &Address,
) -> TxResultwhere
CA: 'static + WasmCacheAccess + Sync,
Checks if the Tx can be deserialized from bytes. Checks the fees and signatures of the fee payer for a transaction if it is a wrapper tx.
Checks validity of an inner tx.
Error codes: 0: Ok 1: Wasm runtime error 2: Invalid tx 3: Tx is invalidly signed 4: Block is full 5: Replay attempt 6. Tx targets a different chain id 7. Tx is expired 8. Tx exceeds the gas limit 9. Tx failed to pay fees 10. An error in the vote extensions included in the proposal 11. Not enough block space was available for some tx 12. Tx wasm code is not allowlisted
INVARIANT: This function should not, under any circumstances, modify the state since the proposal could be rejected.
pub fn revert_proposal(&mut self, _req: RevertProposal) -> RevertProposal
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn query(&self, query: Query) -> Query
pub fn query(&self, query: Query) -> Query
Uses path in the query to forward the request to the
right query method and returns the result (which may be
the default if path is not a supported string.
INVARIANT: This method must be stateless.
Sourcepub fn get_balance(&self, token: &Address, owner: &Address) -> Amount
pub fn get_balance(&self, token: &Address, owner: &Address) -> Amount
Simple helper function for the ledger to get balances of the specified token at the specified address
Source§impl Shell<PersistentDB, Sha256Hasher>
impl Shell<PersistentDB, Sha256Hasher>
Sourcepub fn list_snapshots(&self) -> ListSnapshots
pub fn list_snapshots(&self) -> ListSnapshots
List the snapshot files held locally. Furthermore, the number of chunks, as hash of each chunk, and a hash of the chunk metadata are provided so that syncing nodes can verify snapshots they receive.
Sourcepub fn load_snapshot_chunk(&self, req: LoadSnapshotChunk) -> LoadSnapshotChunk
pub fn load_snapshot_chunk(&self, req: LoadSnapshotChunk) -> LoadSnapshotChunk
Load the bytes of a requested chunk and return them to cometbft.
Sourcepub fn offer_snapshot(&mut self, req: OfferSnapshot) -> OfferSnapshot
pub fn offer_snapshot(&mut self, req: OfferSnapshot) -> OfferSnapshot
Decide if a snapshot should be accepted to sync the node forward in time
Sourcepub fn apply_snapshot_chunk(
&mut self,
req: ApplySnapshotChunk,
) -> ApplySnapshotChunk
pub fn apply_snapshot_chunk( &mut self, req: ApplySnapshotChunk, ) -> ApplySnapshotChunk
Write a snapshot chunk to the database
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn validate_bp_roots_vext_list<'iter>(
&'iter self,
vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter,
) -> impl Iterator<Item = Result<Signed<Vext>, VoteExtensionError>> + 'iter
pub fn validate_bp_roots_vext_list<'iter>( &'iter self, vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter, ) -> impl Iterator<Item = Result<Signed<Vext>, VoteExtensionError>> + 'iter
Takes an iterator over Bridge pool root vote extension instances,
and returns another iterator. The latter yields
valid Bridge pool root vote extensions, or the reason why these
are invalid, in the form of a VoteExtensionError.
Sourcepub fn filter_invalid_bp_roots_vexts<'iter>(
&'iter self,
vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter,
) -> impl Iterator<Item = Signed<Vext>> + 'iter
pub fn filter_invalid_bp_roots_vexts<'iter>( &'iter self, vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter, ) -> impl Iterator<Item = Signed<Vext>> + 'iter
Takes a list of signed Bridge pool root vote extensions, and filters out invalid instances. This also de-duplicates the iterator to be unique per validator address.
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn new_ethereum_events(&mut self) -> Vec<EthereumEvent>
pub fn new_ethereum_events(&mut self) -> Vec<EthereumEvent>
Checks the channel from the Ethereum oracle monitoring the fullnode and retrieves all seen Ethereum events.
Sourcepub fn validate_eth_events_vext_list<'iter>(
&'iter self,
vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter,
) -> impl Iterator<Item = Result<Signed<Vext>, VoteExtensionError>> + 'iter
pub fn validate_eth_events_vext_list<'iter>( &'iter self, vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter, ) -> impl Iterator<Item = Result<Signed<Vext>, VoteExtensionError>> + 'iter
Takes an iterator over Ethereum events vote extension instances,
and returns another iterator. The latter yields
valid Ethereum events vote extensions, or the reason why these
are invalid, in the form of a VoteExtensionError.
Sourcepub fn filter_invalid_eth_events_vexts<'iter>(
&'iter self,
vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter,
) -> impl Iterator<Item = Signed<Vext>> + 'iter
pub fn filter_invalid_eth_events_vexts<'iter>( &'iter self, vote_extensions: impl IntoIterator<Item = Signed<Vext>> + 'iter, ) -> impl Iterator<Item = Signed<Vext>> + 'iter
Takes a list of signed Ethereum events vote extensions, and filters out invalid instances.
Sourcepub fn compress_ethereum_events(
&self,
vote_extensions: Vec<Signed<Vext>>,
) -> Option<VextDigest>
pub fn compress_ethereum_events( &self, vote_extensions: Vec<Signed<Vext>>, ) -> Option<VextDigest>
Compresses a set of signed Ethereum events into a single
ethereum_events::VextDigest, whilst filtering invalid
Signed<ethereum_events::Vext> instances in the process.
When vote extensions are being used, this performs a check that at least 2/3 of the validators by voting power have included ethereum events in their vote extension.
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn validate_valset_upd_vext_list(
&self,
vote_extensions: impl IntoIterator<Item = SignedVext> + 'static,
) -> impl Iterator<Item = Result<SignedVext, VoteExtensionError>> + '_
pub fn validate_valset_upd_vext_list( &self, vote_extensions: impl IntoIterator<Item = SignedVext> + 'static, ) -> impl Iterator<Item = Result<SignedVext, VoteExtensionError>> + '_
Takes an iterator over validator set update vote extension instances,
and returns another iterator. The latter yields
valid validator set update vote extensions, or the reason why these
are invalid, in the form of a VoteExtensionError.
Sourcepub fn filter_invalid_valset_upd_vexts(
&self,
vote_extensions: impl IntoIterator<Item = SignedVext> + 'static,
) -> impl Iterator<Item = SignedVext> + '_
pub fn filter_invalid_valset_upd_vexts( &self, vote_extensions: impl IntoIterator<Item = SignedVext> + 'static, ) -> impl Iterator<Item = SignedVext> + '_
Takes a list of signed validator set update vote extensions, and filters out invalid instances.
Sourcepub fn compress_valset_updates(
&self,
vote_extensions: Vec<SignedVext>,
) -> Option<VextDigest>
pub fn compress_valset_updates( &self, vote_extensions: Vec<SignedVext>, ) -> Option<VextDigest>
Compresses a set of signed validator set update vote extensions into a
single validator_set_update::VextDigest, whilst filtering
invalid validator_set_update::SignedVext instances in the
process.
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn craft_extension(&mut self) -> VoteExtension
pub fn craft_extension(&mut self) -> VoteExtension
Creates the data to be added to a vote extension.
INVARIANT: This method must be stateless.
Sourcepub fn extend_vote_with_ethereum_events(&mut self) -> Option<Signed<Vext>>
pub fn extend_vote_with_ethereum_events(&mut self) -> Option<Signed<Vext>>
Extend PreCommit votes with ethereum_events::Vext instances.
Sourcepub fn sign_ethereum_events(
&self,
ethereum_events: Vec<EthereumEvent>,
) -> Option<Signed<Vext>>
pub fn sign_ethereum_events( &self, ethereum_events: Vec<EthereumEvent>, ) -> Option<Signed<Vext>>
Sign the given Ethereum events, and return the associated vote extension protocol transaction.
Sourcepub fn extend_vote_with_bp_roots(&self) -> Option<Signed<Vext>>
pub fn extend_vote_with_bp_roots(&self) -> Option<Signed<Vext>>
Extend PreCommit votes with bridge_pool_roots::Vext instances.
Sourcepub fn extend_vote_with_valset_update(&self) -> Option<SignedVext>
pub fn extend_vote_with_valset_update(&self) -> Option<SignedVext>
Extend PreCommit votes with validator_set_update::Vext
instances.
Sourcepub fn deserialize_vote_extensions<'shell>(
&'shell self,
txs: &'shell mut Vec<TxBytes>,
) -> DrainFilter<'shell, TxBytes, impl FnMut(&mut TxBytes) -> bool + 'shell>
pub fn deserialize_vote_extensions<'shell>( &'shell self, txs: &'shell mut Vec<TxBytes>, ) -> DrainFilter<'shell, TxBytes, impl FnMut(&mut TxBytes) -> bool + 'shell>
Given a slice of TxBytes, return an iterator over the
ones we could deserialize to vote extension protocol txs.
Source§impl Shell<PersistentDB, Sha256Hasher>
impl Shell<PersistentDB, Sha256Hasher>
Sourcepub fn restore_database_from_state_sync(&mut self)
pub fn restore_database_from_state_sync(&mut self)
Restore the database with data fetched from the State Sync protocol.
Source§impl<D, H> Shell<D, H>
impl<D, H> Shell<D, H>
Sourcepub fn new(
config: Ledger,
wasm_dir: PathBuf,
broadcast_sender: UnboundedSender<Vec<u8>>,
eth_oracle: Option<EthereumOracleChannels>,
db_cache: Option<&D::Cache>,
scheduled_migration: Option<ScheduledMigration>,
vp_wasm_compilation_cache: u64,
tx_wasm_compilation_cache: u64,
) -> Self
pub fn new( config: Ledger, wasm_dir: PathBuf, broadcast_sender: UnboundedSender<Vec<u8>>, eth_oracle: Option<EthereumOracleChannels>, db_cache: Option<&D::Cache>, scheduled_migration: Option<ScheduledMigration>, vp_wasm_compilation_cache: u64, tx_wasm_compilation_cache: u64, ) -> Self
Create a new shell from a path to a database and a chain id. Looks up the database with this data and tries to load the last state.
Sourcepub fn event_log_mut(&mut self) -> &mut EventLog
pub fn event_log_mut(&mut self) -> &mut EventLog
Return a mutable reference to the EventLog.
Sourcepub fn last_state(&self, namada_version: &str) -> Info
pub fn last_state(&self, namada_version: &str) -> Info
Load the Merkle root hash and the height of the last committed block, if
any. This is returned when ABCI sends an info request.
Sourcepub fn read_storage_key<T>(&self, key: &Key) -> Option<T>where
T: Clone + BorshDeserialize,
pub fn read_storage_key<T>(&self, key: &Key) -> Option<T>where
T: Clone + BorshDeserialize,
Read the value for a storage key dropping any error
Sourcepub fn read_storage_key_bytes(&self, key: &Key) -> Option<Vec<u8>>
pub fn read_storage_key_bytes(&self, key: &Key) -> Option<Vec<u8>>
Read the bytes for a storage key dropping any error
Sourcepub fn get_validator_set_update_epoch(&self, current_epoch: Epoch) -> Epoch
pub fn get_validator_set_update_epoch(&self, current_epoch: Epoch) -> Epoch
Get the next epoch for which we can request validator set changed
Sourcepub fn commit(&mut self) -> Response
pub fn commit(&mut self) -> Response
Commit a block. Persist the application state and return the Merkle root hash.
Sourcepub fn mempool_validate(&self, tx_bytes: &[u8], _type: MempoolTxType) -> CheckTx
pub fn mempool_validate(&self, tx_bytes: &[u8], _type: MempoolTxType) -> CheckTx
Validate a transaction request. On success, the transaction will included in the mempool and propagated to peers, otherwise it will be rejected.
Sourcepub fn get_current_decision_height(&self) -> BlockHeight
pub fn get_current_decision_height(&self) -> BlockHeight
Retrieves the BlockHeight that is currently being decided.
Sourcepub fn is_deciding_offset_within_epoch(&self, height_offset: u64) -> bool
pub fn is_deciding_offset_within_epoch(&self, height_offset: u64) -> bool
Check if we are at a given BlockHeight offset, height_offset,
within the current epoch.
Trait Implementations§
Auto Trait Implementations§
impl<D, H> Freeze for Shell<D, H>where
D: Freeze,
impl<D = RocksDB, H = Sha256Hasher> !RefUnwindSafe for Shell<D, H>
impl<D, H> Send for Shell<D, H>
impl<D, H> Sync for Shell<D, H>
impl<D, H> Unpin for Shell<D, H>
impl<D = RocksDB, H = Sha256Hasher> !UnwindSafe for Shell<D, H>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> 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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§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 moreSource§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 moreSource§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>
Source§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>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§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>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§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 moreSource§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 moreSource§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
Source§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
Source§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.Source§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.Source§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.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§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 moreSource§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 moreSource§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 moreSource§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 moreSource§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 moreSource§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 moreSource§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.Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.