Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }

Implementations§

Source§

impl Store

Source

pub async fn open(location: &Url) -> Result<Self>

Open against a local filesystem URL or a remote one for which the caller has no extra options to pass (env vars suffice). CLI verbs that load [storage] from config should call Store::open_with_options instead so the same options flow into every dataset open and write.

Source

pub fn lance_cache_bytes(&self) -> u64

Live byte size of the shared Lance session caches (index + metadata). Diagnostic only - walks the caches.

Source

pub async fn open_with_options( location: &Url, storage_options: HashMap<String, String>, caps: RuntimeCaps, ) -> Result<Self>

Open with object-store options (S3 creds, region, endpoint, …) threaded through Lance verbatim. Keys are the standard object_store config names; pond does not parse them. Empty options + default caps is equivalent to Store::open. Cache caps come from the [runtime] config block via crate::substrate::RuntimeCaps.

Source

pub async fn open_local(path: impl AsRef<Path>) -> Result<Self>

Convenience for tests and CLI verbs holding a &Path: wraps the path in a file://... URL via config::url_for_path before opening. Routes through Store::open_with_options so the production policy is applied; tests get the backend-aware local-FS defaults.

Source

pub async fn export_clean_lance_datasets( &self, dest: &Path, ) -> Result<LanceArchiveExport>

Export clean, index-free Lance datasets into dest.

This rewrites the visible rows of each table instead of copying the dataset roots. The resulting manifests therefore contain no references to the source store’s _indices, while messages.vector and messages.embedding_model remain ordinary data columns and are preserved.

Source

pub async fn import_clean_lance_datasets( &self, source: &Path, ) -> Result<LanceArchiveImport>

Source

pub async fn all_session_message_counts(&self) -> Result<HashMap<String, usize>>

Per-session message count - the data-intrinsic freshness key for incremental pond copy. pond is append-only (merge is WhenMatched::DoNothing; no edits or deletes), so this count rises iff a session gained messages, catching growth a MAX(timestamp) key would miss when a new message shares the session’s latest timestamp. The count is source-authored and survives the copy unchanged, so it compares soundly across two stores with independent clocks (spec.md#session-durable-copy). Projects only the one column it counts; resolves the session_id array once per batch and allocates a key only on a session’s first row. Distinct from session_message_counts, which counts a supplied id list one query each; this counts every session in a single scan.

Source

pub async fn all_session_part_counts(&self) -> Result<HashMap<String, usize>>

Source

pub async fn plan_incremental_from(&self, source: &Store) -> Result<DeltaPlan>

Plan an incremental store-to-store copy into self from source, deciding per table whether each source session’s rows can be appended (the destination has none, so they cannot collide) or must be merged (the destination has some, source has more). Reads both id-sets plus per-session message and part counts. Parts have their own data-derived signal so a part added under an existing message routes through merge instead of relying on the closing verify to catch it (spec.md#session-movement-complete).

Source

pub async fn copy_delta_from( &self, source: &Store, plan: &DeltaPlan, ) -> Result<LanceArchiveImport>

Copy the planned delta from source into self, streaming the source scan straight into the destination - no local staging copy. Each table picks its primitive per session from its TablePlan (spec.md#session-durable-copy): append the sessions whose rows are absent here (cannot collide; one commit per scan, bandwidth-bound) then merge the partially-present ones (WhenMatched::DoNothing dedups the rows already there). Append-only storage is what makes the append safe: a re-run re-plans from current destination state, so an interrupted-then-resumed copy never double-appends (landed rows are no longer absent).

Source

pub async fn append_absent_rows( &self, source: &Store, table: Table, filter_column: &'static str, values: &[String], ) -> Result<usize>

Append source rows whose filter_column is in values. Absent rows can’t collide, so append is safe where the count-based plan would merge (spec.md#session-durable-copy). Drives the copy_bench append-vs-merge regression guard.

Source

pub async fn upsert_sessions(&self, sessions: &[Session]) -> Result<()>

Flat write path. Per-row insert/match truth is not synthesized here - honest outcomes come from the pre-existence scan on Self::upsert_session_batch; the CLI sync and wire ingest paths use that, so these helpers only need to surface write failure.

Source

pub async fn upsert_messages( &self, session: &Session, messages: &[MessageWrite<'_>], ) -> Result<()>

Source

pub async fn upsert_parts(&self, parts: &[Part]) -> Result<()>

Source

pub async fn get_session( &self, session_id: &str, ) -> Result<Option<SessionWithMessages>>

Source

pub async fn session_ids(&self) -> Result<Vec<String>>

Every session id currently in the store, unsorted.

Source

pub async fn child_sessions( &self, parent_session_id: &str, ) -> Result<Vec<Session>>

Source

pub async fn session_last_message_ids(&self) -> Result<HashMap<String, String>>

session_id -> last durable message id for the sync freshness gate. Scans stored message data only, never Lance version history: Dataset::versions() is remote-manifest-bound on object stores, and a write timestamp can exist even when a non-atomic ingest did not commit the messages (spec.md#session-movement-complete).

Only emits a key when the session row is ALSO durable. upsert_session_batch commits messages+parts before the session row, so a partial flush can leave a session whose messages are stored but whose session row is not; keying on messages alone would report it fresh and orphan the missing row. Intersecting with the sessions id-set forces a re-ingest that heals it (spec.md#session-movement-complete).

Source

pub async fn session_view( &self, session_id: &str, params: SessionViewParams<'_>, ) -> Result<GetLookup<SessionPage>>

Whole-session view for pond_get session scope (spec.md#protocol). Always the conversational view (search_text IS NOT NULL) with one-line part summaries - full part bodies are reached by message_id scope, not here. The page is the window selected by the anchors (after_message_id pages forward, before_message_id pages backward) or, with neither, session_from (start/end); it is bounded by limit and a byte budget, never cutting mid-message. before_remaining/after_remaining drive the bidirectional page markers.

Source

pub async fn message_view( &self, message_id: &str, params: MessageViewParams, ) -> Result<GetLookup<MessagePage>>

Message-scope retrieval for pond_get message scope (spec.md#protocol): the target with its full parts (budget-bounded) plus context_before conversational siblings before and context_after after it. NotFound when no stored message carries message_id. Sibling parts are carried for summarizing; the target’s parts ride target_parts.

Source

pub async fn scan_conversational_messages( &self, session_id: &str, ) -> Result<Vec<ConversationalRow>>

Conversational scan over one session: rows ordered by (timestamp, id), IsNotNull("search_text") pushed down at the read seam (spec.md#search-prefilter-pushdown).

Source

pub async fn session_id_for_message( &self, message_id: &str, ) -> Result<Option<String>>

Locate the session id for a stored message. Cheap when only the routing hint is needed - callers that need the messages use scan_all_messages.

Source

pub async fn row_counts(&self) -> Result<(usize, usize, usize)>

Source

pub async fn collect_ids(&self, table: Table) -> Result<HashSet<String>>

The primary-key (id) set for table. Powers storage verification (pond copy --verify-only and copy’s closing check).

Source

pub async fn id_diff_against( &self, table: Table, present: &HashSet<String>, ) -> Result<(usize, usize)>

Stream table’s id column and return (rows_scanned, rows whose id is absent from present). Streaming means the scanned side is never materialized into a set, so a verify holds only the present (other) side per table instead of both.

Source

pub async fn dataset(&self, table: Table) -> Result<Arc<Dataset>>

A point-in-time Arc<Dataset> for table, for registering as a DataFusion LanceTableProvider in pond_sql_query. Goes through the handle’s freshness gate, so each query sees a current snapshot.

Source

pub async fn prewarm(&self, cache_dir: &Path) -> Result<()>

Page the heavy search indices in from storage so the first user query after process start never eats the 175-442 s cold S3 load (spec.md#search). Vector via prewarm_index (loads the IVF_SQ partition storage). FTS is warmed with one synthetic query: Lance’s full FTS prewarm_index loads every token’s posting list, which resident-sets the whole inverted index (~1.7 GiB on the 2M-row corpus) and blows the server RAM budget - so we settle the term dictionary + a hot token instead and let real queries page their own postings. Best effort: a missing index (IVF_SQ below activation, or no FTS yet on an empty store) is logged, not fatal.

Source

pub async fn ensure_rowmap(&self, cache_dir: &Path) -> Result<()>

Install the resident meta map covering the current messages version. Idempotent - a chain already at that version is kept. On a version bump it layers a delta segment (scanning only the new fragments), compacts the deltas locally once they pile up, and full-rebuilds the base only on a store compaction - all under a build flock so N local processes don’t rescan the store at once.

Source

pub fn rowmap_snapshot(&self) -> Option<Arc<RowMetaSet>>

The currently-installed resident meta map, if any. pond sync reads it (via RowmapOracle) as the freshness oracle (max timestamp per session); None falls back to re-reading every source.

Source

pub async fn export_write(&self, name: &str, bytes: &[u8]) -> Result<()>

Write a pond_sql_query export artifact.

Source

pub async fn export_read(&self, name: &str) -> Result<Vec<u8>>

Read a pond_sql_query export artifact back.

Source

pub fn export_local_path(&self, name: &str) -> Option<PathBuf>

Local filesystem path of an export artifact on file:// installs.

Source

pub async fn adapter_names( &self, include_subagents: bool, ) -> Result<Vec<String>>

Distinct adapter names present in the corpus, sorted. Scans only the source_agent column of the small sessions table, so pond status gets its adapter count without touching the 2M-row messages table. include_subagents=false drops source_agent values containing / (e.g. claude-code/general-purpose).

Source

pub async fn write_embeddings(&self, rows: &[EmbeddedMessage]) -> Result<()>

Write a batch of embeddings into messages: set vector and embedding_model on each row by (session_id, id) (spec.md#session-embed-from-canonical). The column update goes through the write seam and lands as a new manifest version (append-only).

Source

pub fn pending_embedding_messages( &self, ) -> impl Stream<Item = Result<PendingMessage>> + '_

Stream the backlog of messages needing embedding: rows with search_text set whose vector is null (spec.md#session-embed-from-canonical).

Source

pub fn pending_or_stale_messages( &self, ) -> impl Stream<Item = Result<PendingMessage>> + '_

Stream messages that are either never embedded or stale under the current model. pond optimize --force-embed feeds this to the same unconditional merge_update as the normal backlog; the filter makes that semantically equivalent to the conditional update in spec.md#session-embed-from-canonical.

BM25 full-text retriever over messages.search_text. With the row meta map loaded the scan is index-only (no data columns -> no TakeExec, no scattered GETs) and hits resolve through the map; otherwise it falls back to fts_search_keys so search works before prewarm.

Source

pub async fn messages_version(&self) -> Result<u64>

Current messages dataset version - the key a RowMetaMap is built against (pond’s stable row ids keep a built map valid until this advances).

Source

pub async fn collect_row_metas(&self) -> Result<Vec<RowMetaEntry>>

Scan the hydration columns with row ids into a Vec, the input to RowMetaMap::build. One large sequential scan (few big reads), unlike the scattered per-hit take it replaces; search_text dominates the bytes.

Source

pub async fn searchable_in_scope(&self, filter: &Predicate) -> Result<usize>

Count of searchable messages (non-null search_text) inside the caller’s filter scope - the universe a search actually ran over. Powers the response’s absence honesty (spec.md#search): “no relevant hits” only means something relative to how many messages were searchable at all, and 0 tells the caller their filters excluded everything before retrieval even started.

Source

pub async fn has_embeddings(&self) -> Result<bool>

Whether any messages row carries a vector (spec.md#search) - the signal that lets the vector arm run instead of degrading to fts. The single-active- model invariant (see MESSAGE_SCALAR_INDICES) means any non-null vector belongs to the current model.

Source

pub async fn sample_embedded_model(&self) -> Result<Option<String>>

One embedded row’s model id, or None when nothing is embedded yet. A LIMIT 1 point read: the single-active-model invariant (see has_embeddings) means any embedded row’s model is representative, so a model swap is detectable by comparing this to the configured model - without the full-column stale_embedding_count scan that ran every sync.

Vector kNN retriever over messages.vector, prefiltered by the caller’s scalar predicate alone (spec.md#search-prefilter-pushdown) - see embedded_scope for why pond does NOT add vector IS NOT NULL. nprobes falls back to DEFAULT_NPROBES when [search] leaves it unset, so a default install never inherits Lance’s unbounded “probe every partition” behavior on a remote store. No refine (see apply_vector_search_knobs). Index-only + map resolve when loaded, else key projection - see fts_search.

Source

pub async fn explain_vector_plan( &self, query: &[f32], limit: usize, filter: &Predicate, search: Option<&SearchConfig>, ) -> Result<String>

The DataFusion plan string for a filtered vector scan - the search-prefilter-pushdown regression guard reads it.

Source

pub async fn explain_fts_plan( &self, query: &str, limit: usize, filter: &Predicate, ) -> Result<String>

Source

pub async fn message_metas_by_rowids( &self, rowids: &[u64], ) -> Result<Vec<MessageMeta>>

Hydrate search hits by stable row id (spec.md#search). Resolves each rowid from the resident meta map in memory (no object-store round-trip - Lance caches index/metadata but never data column values, so a take_rows re-reads search_text from storage every query). Rowids the map lacks (appended since it was built, or no map loaded) fall back to a single take_rows batch. The caller indexes the result by key, so order is irrelevant.

Source

pub async fn message_metas_by_keys( &self, keys: &[MessageKey], ) -> Result<Vec<MessageMeta>>

Hydrate search hits: fetch message metadata for (session_id, message_id) keys.

Source

pub async fn session_message_counts( &self, session_ids: &[String], ) -> Result<BTreeMap<String, usize>>

Total message count per session, for search session summaries. One session_id IN (...) scan projecting only session_id, aggregated in pond, instead of N concurrent count_rows(session_id = X) round-trips against messages_session_id_btree. Same wire shape for any backend, but one S3 operation instead of N on remote stores. Sessions with zero matching messages are present in the map with count 0 so the caller can distinguish “filter excluded everything” from “session missing from the response.”

Source

pub async fn unindexed_message_backlog(&self) -> Result<usize>

Rows appended to messages since the FTS index was last optimized. A missing index reports the whole table; the query is manifest-only.

Source

pub async fn unindexed_vector_backlog(&self) -> Result<usize>

Rows added or rewritten in messages since the IVF_SQ vector index was last optimized. Below VECTOR_INDEX_ACTIVATION_ROWS no index exists yet, so the caller must read embedding_progress too and distinguish “index not built yet” from “index trails data”.

Source

pub async fn embedding_progress(&self) -> Result<EmbeddingProgress>

Embedding coverage: how many messages rows carry a vector and how many are still eligible. Drives the pond status embeddings line and the pond optimize progress bar’s known total.

Source

pub async fn embed_backlog_count(&self) -> Result<usize>

Messages eligible but not yet embedded (search_text present, embedding_model null) - the exact set crate::embed::EmbedWorker processes. Read straight from the dataset so it is correct right after ingest, unlike the FTS num_docs embedding_progress shows (which lags until the index is rebuilt - the embed stage runs before that).

Source

pub async fn stale_embedding_count(&self) -> Result<usize>

Count rows whose embedding_model is not the currently configured model AND whose vector is still populated - the signal pond optimize uses to detect a model swap and require --force-embed.

Source

pub async fn optimize_indices( &self, progress: Option<OptimizeProgressFn>, maintenance: &MaintenancePolicy, ) -> Result<OptimizeOutcome>

Run the per-table maintenance cycle (compact + indices) across every table, never short-circuiting. spec.md#lance-index-maintenance: indices and compaction commit independently, so a hot writer that starves compaction on one table does not abort the index work the operator asked for on other tables (or even on the same table).

Source

pub async fn build_indices_only( &self, progress: Option<OptimizeProgressFn>, ) -> Result<OptimizeOutcome>

Fold trailing fragments into existing indices across every table, without running compaction. Used by pond optimize’s tail so newly written vectors land in the FTS / IVF_SQ / btree / bitmap indices without paying the compaction retry budget while embed itself may still be writing in a sibling process.

Source

pub async fn cleanup_old_versions(&self, older_than: Duration) -> Result<()>

Reclaim superseded data/index files across every indexed table (Lance cleanup_old_versions), without compaction. pond optimize --rebuild runs this after the rebuild so the index segments it just replaced are dropped immediately. The retention floor still protects versions a live reader may have pinned (spec.md#concurrency).

Source

pub async fn rebuild_indices( &self, intent_name: Option<&str>, progress: Option<OptimizeProgressFn>, ) -> Result<()>

Source

pub async fn drop_index_by_name(&self, name: &str) -> Result<()>

Drop a named index from whichever table owns it. Used by pond optimize --drop-index <name> to clean up orphaned indices (e.g. after renaming an intent whose on-disk name no longer matches the policy). Finds the owning table via parallel load_indices lookups, then drops on just that table - so real I/O errors surface with the right context instead of being hidden behind “no such index” from the wrong table.

Source

pub async fn index_status(&self) -> Result<Vec<IndexStatus>>

Source

pub async fn drop_vector_index(&self) -> Result<()>

Drop the IVF_SQ index on messages.vector. Used by pond optimize --force-embed before re-bootstrapping under a different model. Silent when the index does not exist.

Source

pub async fn table_sizes(&self) -> Result<TableSizes>

On-disk byte totals per dataset, sized through Lance’s object store (spec.md#lance-chokepoints-storage) so pond status works on any backend.

Source

pub async fn initialized(&self) -> Result<bool>

Source

pub async fn parts_for_messages( &self, session_id: &str, message_ids: &[String], ) -> Result<BTreeMap<(String, String), Vec<Part>>>

Every part of these messages, full fidelity (file blobs included). The canonical read primitive - restore/export, verbatim mode, and the message-mode target all need the complete set.

Source

pub async fn summary_parts_for_messages( &self, session_id: &str, message_ids: &[String], ) -> Result<BTreeMap<(String, String), Vec<Part>>>

Only the parts that yield a [PartSummary] (SUMMARY_PART_TYPES), skipping text/reasoning (and their blobs) that would summarize to nothing. For the summary-only reads (conversational/complete session views, search hits) - it never feeds restore/export.

Trait Implementations§

Source§

impl Debug for Store

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl !RefUnwindSafe for Store

§

impl !UnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

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> Conv for T

Source§

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

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

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Paint for T
where T: ?Sized,

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1:

renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<E> ResultError for E
where E: Send + Debug + Sync,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

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

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

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool