Skip to main content

SqliteStore

Struct SqliteStore 

Source
pub struct SqliteStore { /* private fields */ }
Expand description

Represents a pool of connections with an SQLite database. The pool is used to interact concurrently with the underlying database in a safe and efficient manner.

Current table definitions can be found at store.sql migration file.

Implementations§

Source§

impl SqliteStore

Source

pub fn get_foreign_account_code( conn: &mut Connection, account_ids: Vec<AccountId>, ) -> Result<BTreeMap<AccountId, AccountCode>, StoreError>

Source

pub fn get_account_vault( conn: &Connection, account_id: AccountId, ) -> Result<AssetVault, StoreError>

Retrieves the full asset vault for a specific account.

Source

pub fn get_account_storage( conn: &Connection, account_id: AccountId, filter: &AccountStorageFilter, ) -> Result<AccountStorage, StoreError>

Retrieves the full storage for a specific account.

Source

pub fn upsert_foreign_account_code( conn: &mut Connection, account_id: AccountId, code: &AccountCode, ) -> Result<(), StoreError>

Source§

impl SqliteStore

Source

pub fn insert_partial_blockchain_nodes( conn: &mut Connection, nodes: &[(InOrderIndex, Word)], ) -> Result<(), StoreError>

Source

pub fn prune_irrelevant_blocks(conn: &mut Connection) -> Result<(), StoreError>

Removes block headers that do not contain any client notes and aren’t the genesis or last block.

Source§

impl SqliteStore

Source

pub fn get_transactions( conn: &mut Connection, filter: &TransactionFilter, ) -> Result<Vec<TransactionRecord>, StoreError>

Retrieves tracked transactions, filtered by TransactionFilter.

Source

pub fn apply_transaction( conn: &mut Connection, smt_forest: &Arc<RwLock<AccountSmtForest>>, tx_update: &TransactionStoreUpdate, ) -> Result<(), StoreError>

Inserts a transaction and updates the current state based on the tx_result changes.

Source§

impl SqliteStore

Source

pub async fn new(database_filepath: PathBuf) -> Result<Self, StoreError>

Returns a new instance of Store instantiated with the specified configuration options.

Trait Implementations§

Source§

impl Store for SqliteStore

Source§

fn get_current_timestamp(&self) -> Option<u64>

Returns the current timestamp tracked by the store, measured in non-leap seconds since Unix epoch. If the store implementation is incapable of tracking time, it should return None. Read more
Source§

fn get_note_tags<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<NoteTagRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the note tag records that the client is interested in.
Source§

fn get_unique_note_tags<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BTreeSet<NoteTag>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the unique note tags (without source) that the client is interested in.
Source§

fn add_note_tag<'life0, 'async_trait>( &'life0 self, tag: NoteTagRecord, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Adds a note tag to the list of tags that the client is interested in. Read more
Source§

fn remove_note_tag<'life0, 'async_trait>( &'life0 self, tag: NoteTagRecord, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes a note tag from the list of tags that the client is interested in. Read more
Source§

fn get_sync_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BlockNumber, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the block number of the last state sync block.
Source§

fn apply_state_sync<'life0, 'async_trait>( &'life0 self, state_sync_update: StateSyncUpdate, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Applies the state sync update to the store. An update involves: Read more
Source§

fn get_transactions<'life0, 'async_trait>( &'life0 self, transaction_filter: TransactionFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves stored transactions, filtered by TransactionFilter.
Source§

fn apply_transaction<'life0, 'async_trait>( &'life0 self, tx_update: TransactionStoreUpdate, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Applies a transaction, atomically updating the current state based on the TransactionStoreUpdate. Read more
Source§

fn get_input_notes<'life0, 'async_trait>( &'life0 self, filter: NoteFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<InputNoteRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the input notes from the store.
Source§

fn get_output_notes<'life0, 'async_trait>( &'life0 self, note_filter: NoteFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<OutputNoteRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the output notes from the store.
Source§

fn upsert_input_notes<'life0, 'life1, 'async_trait>( &'life0 self, notes: &'life1 [InputNoteRecord], ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inserts the provided input notes into the database. If a note with the same ID already exists, it will be replaced.
Source§

fn get_note_script<'life0, 'async_trait>( &'life0 self, script_root: Word, ) -> Pin<Box<dyn Future<Output = Result<NoteScript, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the note script associated with the given root.
Source§

fn upsert_note_scripts<'life0, 'life1, 'async_trait>( &'life0 self, note_scripts: &'life1 [NoteScript], ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inserts the provided note scripts into the database. If a script with the same root already exists, it will be replaced.
Source§

fn insert_block_header<'life0, 'life1, 'async_trait>( &'life0 self, block_header: &'life1 BlockHeader, partial_blockchain_peaks: MmrPeaks, has_client_notes: bool, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inserts a block header into the store, alongside peaks information at the block’s height. Read more
Source§

fn prune_irrelevant_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes block headers that do not contain any client notes and aren’t the genesis or last block.
Source§

fn get_block_headers<'life0, 'life1, 'async_trait>( &'life0 self, block_numbers: &'life1 BTreeSet<BlockNumber>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves a vector of BlockHeaders filtered by the provided block numbers. Read more
Source§

fn get_tracked_block_headers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockHeader>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a list of BlockHeader that include relevant notes to the client.
Source§

fn get_partial_blockchain_nodes<'life0, 'async_trait>( &'life0 self, filter: PartialBlockchainFilter, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<InOrderIndex, Word>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves all MMR authentication nodes based on PartialBlockchainFilter.
Source§

fn insert_partial_blockchain_nodes<'life0, 'life1, 'async_trait>( &'life0 self, nodes: &'life1 [(InOrderIndex, Word)], ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inserts blockchain MMR authentication nodes. Read more
Source§

fn get_partial_blockchain_peaks_by_block_num<'life0, 'async_trait>( &'life0 self, block_num: BlockNumber, ) -> Pin<Box<dyn Future<Output = Result<MmrPeaks, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns peaks information from the blockchain by a specific block number. Read more
Source§

fn insert_account<'life0, 'life1, 'async_trait>( &'life0 self, account: &'life1 Account, initial_address: Address, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inserts an Account to the store. Receives an Address as the initial address to associate with the account. This address will be tracked for incoming notes and its derived note tag will be monitored. Read more
Source§

fn update_account<'life0, 'life1, 'async_trait>( &'life0 self, account: &'life1 Account, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Updates an existing Account with a new state. Read more
Source§

fn get_account_ids<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<AccountId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the account IDs of all accounts stored in the database.
Source§

fn get_account_headers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of AccountHeader of all accounts stored in the database along with their statuses. Read more
Source§

fn get_account_header<'life0, 'async_trait>( &'life0 self, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<Option<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves an AccountHeader object for the specified AccountId along with its status. Returns None if the account is not found. Read more
Source§

fn get_account_header_by_commitment<'life0, 'async_trait>( &'life0 self, account_commitment: Word, ) -> Pin<Box<dyn Future<Output = Result<Option<AccountHeader>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns an AccountHeader corresponding to the stored account state that matches the given commitment. If no account state matches the provided commitment, None is returned.
Source§

fn get_account<'life0, 'async_trait>( &'life0 self, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a full AccountRecord object, this contains the account’s latest state along with its status. Returns None if the account is not found.
Source§

fn upsert_foreign_account_code<'life0, 'async_trait>( &'life0 self, account_id: AccountId, code: AccountCode, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Upserts the account code for a foreign account. This value will be used as a cache of known script roots and added to the GetForeignAccountCode request.
Source§

fn get_foreign_account_code<'life0, 'async_trait>( &'life0 self, account_ids: Vec<AccountId>, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<AccountId, AccountCode>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the cached account code for various foreign accounts.
Source§

fn set_setting<'life0, 'async_trait>( &'life0 self, key: String, value: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Adds a value to the settings table.
Source§

fn get_setting<'life0, 'async_trait>( &'life0 self, key: String, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a value from the settings table.
Source§

fn remove_setting<'life0, 'async_trait>( &'life0 self, key: String, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deletes a value from the settings table.
Source§

fn list_setting_keys<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns all the keys from the settings table.
Source§

fn get_unspent_input_note_nullifiers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Nullifier>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the nullifiers of all unspent input notes. Read more
Source§

fn get_account_vault<'life0, 'async_trait>( &'life0 self, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<AssetVault, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the asset vault for a specific account.
Source§

fn get_account_asset<'life0, 'async_trait>( &'life0 self, account_id: AccountId, vault_key: AssetVaultKey, ) -> Pin<Box<dyn Future<Output = Result<Option<(Asset, AssetWitness)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a specific asset (by vault key) from the account’s vault along with its Merkle witness. Read more
Source§

fn get_account_storage<'life0, 'async_trait>( &'life0 self, account_id: AccountId, filter: AccountStorageFilter, ) -> Pin<Box<dyn Future<Output = Result<AccountStorage, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the storage for a specific account. Read more
Source§

fn get_account_map_item<'life0, 'async_trait>( &'life0 self, account_id: AccountId, slot_name: StorageSlotName, key: Word, ) -> Pin<Box<dyn Future<Output = Result<(Word, StorageMapWitness), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a specific item from the account’s storage map along with its Merkle proof. Read more
Source§

fn get_addresses_by_account_id<'life0, 'async_trait>( &'life0 self, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves all Address objects that correspond to the provided account ID.
Source§

fn insert_address<'life0, 'async_trait>( &'life0 self, address: Address, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Adds an Address to an Account, alongside its derived note tag.
Source§

fn remove_address<'life0, 'async_trait>( &'life0 self, address: Address, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes an Address from an Account, alongside its derived note tag.
Source§

fn get_minimal_partial_account<'life0, 'async_trait>( &'life0 self, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves an AccountRecord object, this contains the account’s latest partial state along with its status. Returns None if the partial account is not found.
Source§

fn get_block_header_by_num<'life0, 'async_trait>( &'life0 self, block_number: BlockNumber, ) -> Pin<Box<dyn Future<Output = Result<Option<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Retrieves a BlockHeader corresponding to the provided block number and a boolean value that represents whether the block contains notes relevant to the client. Returns None if the block is not found. Read more
Source§

fn get_note_transport_cursor<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<NoteTransportCursor, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Gets the note transport cursor. Read more
Source§

fn update_note_transport_cursor<'life0, 'async_trait>( &'life0 self, cursor: NoteTransportCursor, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Updates the note transport cursor. Read more
Source§

fn get_current_partial_mmr<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PartialMmr, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Builds the current view of the chain’s PartialMmr. Because we want to add all new authentication nodes that could come from applying the MMR updates, we need to track all known leaves thus far. Read more

Auto Trait Implementations§

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

Source§

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

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

impl<D> OwoColorize for D

Source§

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

Set the foreground color generically Read more
Source§

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

Set the background color generically. Read more
Source§

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

Change the foreground color to black
Source§

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

Change the background color to black
Source§

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

Change the foreground color to red
Source§

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

Change the background color to red
Source§

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

Change the foreground color to green
Source§

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

Change the background color to green
Source§

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

Change the foreground color to yellow
Source§

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

Change the background color to yellow
Source§

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

Change the foreground color to blue
Source§

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

Change the background color to blue
Source§

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

Change the foreground color to magenta
Source§

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

Change the background color to magenta
Source§

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

Change the foreground color to purple
Source§

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

Change the background color to purple
Source§

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

Change the foreground color to cyan
Source§

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

Change the background color to cyan
Source§

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

Change the foreground color to white
Source§

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

Change the background color to white
Source§

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

Change the foreground color to the terminal default
Source§

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

Change the background color to the terminal default
Source§

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

Change the foreground color to bright black
Source§

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

Change the background color to bright black
Source§

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

Change the foreground color to bright red
Source§

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

Change the background color to bright red
Source§

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

Change the foreground color to bright green
Source§

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

Change the background color to bright green
Source§

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

Change the foreground color to bright yellow
Source§

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

Change the background color to bright yellow
Source§

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

Change the foreground color to bright blue
Source§

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

Change the background color to bright blue
Source§

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

Change the foreground color to bright magenta
Source§

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

Change the background color to bright magenta
Source§

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

Change the foreground color to bright purple
Source§

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

Change the background color to bright purple
Source§

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

Change the foreground color to bright cyan
Source§

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

Change the background color to bright cyan
Source§

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

Change the foreground color to bright white
Source§

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

Change the background color to bright white
Source§

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

Make the text bold
Source§

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

Make the text dim
Source§

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

Make the text italicized
Source§

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

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

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

Swap the foreground and background colors
Source§

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

Hide the text
Source§

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

Cross out the text
Source§

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

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

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

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

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

Sets the foreground color to an RGB value.
Source§

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

Sets the background color to an RGB value.
Source§

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

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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