Skip to main content

HomeState

Struct HomeState 

Source
pub struct HomeState {
Show 53 fields pub sections: Vec<Section>, pub filter: String, pub filter_selected: bool, pub search_limit: usize, pub found_scores: Option<(String, Vec<i32>)>, pub hide_unreadable: bool, pub formats: Arc<Registry>, pub lake_here: Option<(PathBuf, &'static str)>, pub selected: usize, pub scroll: usize, pub view_height: usize, pub path_input_active: bool, pub path_input: String, pub path_listing: Option<PathListing>, pub path_pick: Option<usize>, pub browsing: Option<PathBuf>, pub browse_start: Option<PathBuf>, pub status: Option<String>, pub network_check: fn(&Path) -> bool, pub visits: HashMap<PathBuf, Visits>, pub newest_recent: Option<PathBuf>, pub probed: HashMap<PathBuf, Vec<Entry>>, pub unreachable: HashSet<PathBuf>, pub listing_so_far: HashMap<PathBuf, Vec<Entry>>, pub cut_short: HashSet<PathBuf>, pub narrowed: Option<Narrowed>, pub probe_errors: HashMap<PathBuf, String>, pub cloud_kinds: HashMap<PathBuf, (EntryKind, Holds)>, pub sort: SortMode, pub listing_in_flight: bool, pub measure_in_flight: bool, pub classify_in_flight: bool, pub pending_enrich: bool, pub pending_classify: bool, pub pending_peek: bool, pub peeking: HashSet<PathBuf>, pub peek_failed: HashSet<PathBuf>, pub enriched: HashMap<PathBuf, Measured>, pub folds: HashMap<String, bool>, pub folds_owed: bool, pub search: SearchState, pub known: HashMap<PathBuf, DatasetFacts>, pub cloud: Vec<CloudSource>, pub catalogs: Vec<ShownCatalog>, pub sized: HashSet<PathBuf>, pub web_gone: HashMap<PathBuf, HttpGone>, pub missing: HashSet<PathBuf>, pub waiting_since: Option<Instant>, pub recent_expanded: bool, pub trail: Vec<Mark>, pub returning: Option<RowKey>, pub returning_line: Option<usize>, pub landing: bool,
}
Expand description

Home screen state.

Fields§

§sections: Vec<Section>§filter: String

Fuzzy filter over every row in every section.

§filter_selected: bool

The filter kept from before a dataset was opened, shown selected: the next character typed replaces it, and ~ opens the path prompt, rather than both adding to a search that is done. Any other key keeps it.

§search_limit: usize

The most search matches listed under Found: [home.search] max_results.

§found_scores: Option<(String, Vec<i32>)>

The filter Found’s rows were scored for, and the score of each of its first rows, in order. Listing a thousand matches scored each of them again on every pass over the rows, several per frame.

§hide_unreadable: bool

Leave out files datui has no reader for. Ctrl+A flips it; they are hidden by default.

§formats: Arc<Registry>

The format specs on the search path: a file one of them names by its glob is listed as data, under the spec’s name.

§lake_here: Option<(PathBuf, &'static str)>

The lake table being browsed, and its format. Said on its heading for as long as the browse lasts, since it is a fact about the directory rather than an event.

§selected: usize

Index into the flattened list of currently visible rows.

§scroll: usize

First row of the last frame drawn, as an index into HomeState::visible.

Written by the renderer, which is the only place that knows how tall the list is, and read by HomeState::unclassified_visible so that what gets looked into is what is being looked at. Zero until a frame has been drawn, which is the list scrolled to the top and so a safe place to start.

§view_height: usize

How many rows the last frame had room for. See HomeState::scroll.

§path_input_active: bool

True while the user is typing a path directly.

§path_input: String§path_listing: Option<PathListing>

What the ~ prompt lists: the directory being typed and the names in it.

§path_pick: Option<usize>

The name ↑↓ put the cursor on, among those the last segment matches.

§browsing: Option<PathBuf>

Directory the user has descended into, if any. None means the root listing.

§browse_start: Option<PathBuf>

Where the current browse began: the directory entered from the root listing or jumped to by path. Esc climbs back to here and then to the listing, so it never wanders above the place the user started from. None treats browsing itself as the start.

§status: Option<String>

Transient message (e.g. a path that does not exist).

§network_check: fn(&Path) -> bool

How a path is judged to be network-backed. Swappable so the “never touch a remote path on this thread” rule can be tested without a remote.

§visits: HashMap<PathBuf, Visits>

How often and how lately each recent was opened: ranks matches (#547 M9).

§newest_recent: Option<PathBuf>

The recent opened last. Recent is ranked by frecency, and the cursor lands here so the last file is still one Enter away.

§probed: HashMap<PathBuf, Vec<Entry>>

Network roots whose listing has come back, keyed by path.

§unreachable: HashSet<PathBuf>

Network roots that did not answer.

§listing_so_far: HashMap<PathBuf, Vec<Entry>>

The rows of network directories still being listed, read so far.

§cut_short: HashSet<PathBuf>

Network directories whose listing stopped at discover::MAX_ENTRIES_PER_DIR.

§narrowed: Option<Narrowed>

The names a filter asked the server for, in a cloud directory cut short.

§probe_errors: HashMap<PathBuf, String>

Why a cloud listing was refused, when the service said.

§cloud_kinds: HashMap<PathBuf, (EntryKind, Holds)>

What cloud directories turned out to hold when peeked into: hive or multi. Kept for the session, so a directory is peeked at once however often it is listed.

§sort: SortMode

How rows are ordered inside each section.

§listing_in_flight: bool

True while a listing is being built on a worker. The previous listing stays on screen meanwhile, so a refresh never blanks the view.

§measure_in_flight: bool

True while a measurement batch is out, so only one is in flight at a time.

§classify_in_flight: bool

True while a classification batch is out. One at a time, and the next batch is chosen from the viewport as it is then — which is what keeps paging quickly from queueing a classification for every row it passed over.

§pending_enrich: bool

Set while rows on screen are still unmeasured, so the main loop knows to draw another frame and measure the next batch.

§pending_classify: bool

The same, for rows on screen nothing has looked into yet.

§pending_peek: bool

The same, for cloud directories on screen nothing has peeked into yet.

§peeking: HashSet<PathBuf>

Cloud directories with a peek out. Their own set rather than a claim written into Self::cloud_kinds: a claim is an answer, and writing one before the request comes back put dir on a row that had a count and staked “never again this session” on a request that might fail.

§peek_failed: HashSet<PathBuf>

Cloud directories whose peek failed: not asked again until Ctrl+R, and labelled ? rather than dir, which would claim there is no data inside.

§enriched: HashMap<PathBuf, Measured>

Row and column counts already read, keyed by path. Reading a Parquet footer is cheap; reading several hundred of them is not, so results are kept for the session and each dataset is measured once.

§folds: HashMap<String, bool>

Sections the user has folded or opened, by title, true meaning folded. A section not listed here takes its own default. Keyed by title rather than index so the state survives a rebuild, which reorders and renumbers sections, and kept in the cache so it survives a restart. Use HomeState::toggle_collapsed and HomeState::set_collapsed rather than touching this directly.

§folds_owed: bool

The saved folds are to be read again, with the next listing: entering the home screen asks for them, and they arrive with the rows they fold.

§search: SearchState

Datasets found by walking below the working directory.

§known: HashMap<PathBuf, DatasetFacts>

What datui measured on previous runs, keyed by path — the same index the listing was annotated from, kept here so rows the recursive search finds can be filled in the same way (columns are what the filter matches on).

§cloud: Vec<CloudSource>

Cloud sources discovered on this machine or named in the config, with their buckets. Empty on a machine with no cloud credentials, which is the common case and not a failure.

§catalogs: Vec<ShownCatalog>

The catalogs shown, each a section of its own.

§sized: HashSet<PathBuf>

HTTP(S) catalog files whose size was asked for this session (a HEAD).

§web_gone: HashMap<PathBuf, HttpGone>

HTTP(S) catalog files that HEAD settled cannot be had: not there, or no server answered. Asked again on Ctrl+R.

§missing: HashSet<PathBuf>

Local datasets of a catalog that the last listing found missing.

§waiting_since: Option<Instant>

When the current wait for a remote listing began, for the elapsed time on screen.

§recent_expanded: bool

RECENT shows every place, however many rows that takes. Set by Enter on the … N more row, for the session.

§trail: Vec<Mark>

The listings the user went inside from, outermost first: where to put the cursor back on the way out. See HomeState::leave_mark.

§returning: Option<RowKey>

The row the cursor goes back to once the listing being returned to lands. Held across listings while rows are still arriving, since the row may not be in the first one; dropped as soon as the user moves the cursor.

§returning_line: Option<usize>

How far down the list the row being returned to was when the user left it, so it comes back on the same line rather than wherever the scroll falls.

§landing: bool

The cursor is where HomeState::select_first_entry put it, and the user has not moved it since: a door the footers turn down afterwards takes it to the first row.

Implementations§

Source§

impl HomeState

Source

pub const SEARCH_SECTION: &'static str = "Found"

Lines currently on screen: a header per non-empty section, followed by its matching rows unless it is collapsed.

Results stay grouped even while filtering. Ranking them across sections would read better as a hit list, but it costs the one thing the grouping is for — seeing where a dataset lives — and a name on its own rarely says that. Title of the section holding recursive search results.

A constant because collapse state is keyed by title, and because the renderer and the tests both need to name it.

Source

pub const CLOUD_SECTION: &'static str = "Cloud"

Title of the section listing cloud sources.

Source

pub const RECENT_SECTION: &'static str = "Recent"

Title of the section listing what has been opened, grouped by place.

Source

pub fn roots(desktop_dirs: &[PathBuf]) -> Vec<Root>

Gather roots from the working directory and the desktop.

Where you are first, then the directories the desktop says you have opened data from. Duplicates collapse to the first. Recents do not make roots: the place a recent lives in is a row of RECENT.

Source

pub fn roots_with( desktop_dirs: &[PathBuf], is_network: fn(&Path) -> bool, ) -> Vec<Root>

As HomeState::roots, with the network test injected.

Source

pub fn rebuild(&mut self, recents: &[PathBuf])

Build the home listing.

Recents lead, because for data on a mount the thing you want is almost always something you have opened before. Roots follow, each scanned one level deep.

Source

pub fn rebuild_with(&mut self, recents: &[PathBuf], desktop_dirs: &[PathBuf])

As HomeState::rebuild, plus directories derived from the desktop’s own recently-used list.

Source

pub fn apply_listing(&mut self, listing: Listing)

Install a listing built elsewhere, keeping the cursor on whatever it was on.

Source

pub fn leave_mark(&mut self)

Remember where the cursor is before going inside something, so leaving comes back to it. Call before browsing changes.

Source

pub fn come_back(&mut self, from: Option<PathBuf>)

Come back to the place now browsed, from from: the filter and search it had, and the cursor on the row it was on once the listing lands. Call after browsing is set.

A place never entered from — Backspace above where the browse began — puts the cursor on the place just left instead, which is the row that leads back to it.

Source

pub fn selected_key(&self) -> Option<RowKey>

What the cursor is on, as something that survives the rows changing.

Source

pub fn reselect(&mut self, key: Option<RowKey>) -> bool

Put the cursor back on the row key names, if it is still on screen. Says whether the cursor was placed by the key; when it was not, the cursor is clamped, so a cursor left past the end by rows disappearing is never left there.

A row the cap has just hidden is still there, behind the more row that now stands for it, so the cursor goes to that row rather than to whatever fell into its index in the section below — and that counts as placed.

Source

pub fn set_view_height(&mut self, height: usize)

Tell the listing how tall the list is, keeping the cursor on the row it was on.

The cap on RECENT is a share of this height, so a shorter terminal takes rows out from under the cursor and a taller one puts rows in above it. The renderer calls this every frame; only a change in height does any work.

Source

pub fn is_collapsed(&self, section: usize) -> bool

Whether a section is collapsed.

Source

pub fn toggle_collapsed(&mut self, section: usize)

Collapse or expand a section.

Source

pub fn set_collapsed(&mut self, section: usize, collapsed: bool)

Nothing is remembered while browsing: the listing browsed into is never drawn folded (see section_folded), and a fold written for it would be a fold for its path, which is the title the same directory has as a configured or current directory section on the root listing.

Source

pub fn jump_section(&mut self, delta: isize)

Move the cursor to the next (delta > 0) or previous section header, wrapping. The way past a long section to the one you came for.

Source

pub fn has_any_dataset(&self) -> bool

Whether the listing holds anything openable at all, folded or not.

A lake table counts. datui cannot read one as a table yet, so it is not a dataset — but it is somewhere to go, and a warehouse directory of fifty delta rows with “No datasets here.” printed underneath them is plainly wrong.

So does a row nothing has looked into, for the same reason and more sharply: in a fresh listing that is every directory in it, and any of them may turn out to be a dataset. This is EntryKind::is_dataset rather than EntryKind::is_known_dataset on purpose — the question is whether there is anywhere to go, not how many datasets there are, which is what the control bar’s count asks and answers differently.

Source

pub fn cloud_source_of(&self, path: &Path) -> Option<&CloudSource>

The source a place belongs to: cloud://<id> itself, a bucket named with a source (s3://<id>@bucket), or a bucket some source listed.

Source

pub fn parent_of(&self, path: &Path) -> Option<PathBuf>

One level up from path. A bucket’s parent is the source that lists it, so Backspace from a bucket returns to its source rather than to the home listing.

Source

pub fn catalog_dataset( &self, path: &Path, ) -> Option<(&ShownCatalog, &ShownDataset)>

The catalog dataset listed at path itself.

Source

pub fn bookmark(&self, path: &Path) -> Option<(&ShownDataset, &str)>

The dataset a bookmark is listed under, and the bookmark’s name.

Source

pub fn size_hint(&self, path: &Path) -> Option<u64>

What a catalog says an HTTP(S) file at path weighs, while nothing has measured it: shown as ~33 MB.

Source

pub fn cloud_look(&self, entry: &Entry) -> Option<CloudLook>

Where a directory in an object store is in being looked into, while its row has no label of its own yet. None once the row says what it holds, or when it is not such a directory.

Source

pub fn place_kind(&self, path: &Path) -> Option<&'static str>

What to call a place a source or catalog names itself: a remote dataset of a catalog, or a local one that is missing.

Source

pub fn place_details(&self, path: &Path) -> Option<&[(String, String)]>

Details-pane lines for a place a cloud source listed or a catalog names, when it has any.

Source

pub fn location_label(&self, path: &Path) -> String

The location as the title bar names it. Cloud places read as a trail through the source’s label, since neither cloud://<id> nor s3://<id>@bucket is something to show a person.

Source

pub fn sync_search_section(&mut self)

Put the current search results into sections, or take them out.

Called after every rebuild and every batch of results. The section only exists while there is a filter: with none, every row matches, and twenty thousand matches is not a home screen.

Source

pub fn search_batch(&mut self, root: &Path, found: Vec<Entry>, scanned: usize)

Fold a batch of search results in, keeping the list free of duplicates.

Source

pub fn score_job(&mut self) -> Option<ScoreJob>

The scoring a worker should do next, if one is owed: the filter has changed, or files arrived since the last. One at a time; the next is asked for when it answers.

Source

pub fn search_scored(&mut self, epoch: u64, scored: Matches)

A worker’s scoring is in.

Source

pub fn search_finished( &mut self, root: &Path, scanned: usize, limited: Option<String>, )

Record that the walk under root has finished.

Source

pub fn visible(&self) -> Vec<Row<'_>>

Source

pub fn listed(&self) -> Vec<Row<'_>>

Every row a section would show, with the cap on RECENT lifted.

For counting what is listed. The header says thirty and the more row says twenty-seven more, so the control bar must not say three.

Source

pub fn path_candidates(&self) -> Vec<&PathName>

The names the ~ prompt offers: those in the directory being typed that its last segment matches, best first. Hidden names only when a dot is typed.

Source

pub fn pick_first_path(&mut self)

Put the ~ prompt’s pick on the first name that matches what is typed, or on none when nothing does: the list always shows which name Enter and Tab take. ↑ from the first takes the typed path as it is.

Source

pub fn picked_path(&self) -> Option<String>

The path the picked candidate names, with its separator when it is a directory.

Source

pub fn path_completion(&self) -> Option<String>

What Tab makes of the typed path: the one candidate whole, or the longest start every candidate shares. None when it would add nothing.

Source

pub fn known_urls(&self) -> Vec<String>

Every URL the screen already knows: catalogs, buckets, what has been listed and what the index remembers. What s3:// completes from.

Source

pub fn selected_row(&self) -> Option<Row<'_>>

The highlighted row, whatever it is.

Source

pub fn selected_entry(&self) -> Option<Entry>

The highlighted row, when it is a dataset rather than a section header.

The door counts: it is something to open, and every caller here wants what the cursor is on. What it must not be is a row in a path-keyed map, which is why it is Row::Door and not an entry among the section’s rows.

Source

pub fn selection_is_the_door(&self) -> bool

Whether the cursor is on the door rather than on something in the directory.

Source

pub fn recents_in(&self, place: &Path) -> Vec<PathBuf>

The recents that live in place: what Delete on its row forgets.

Source

pub fn selected_section(&self) -> Option<usize>

The section the highlighted row belongs to.

Source

pub fn selected_catalog(&self) -> Option<&ShownCatalog>

Whether the highlighted row is a section header. The catalog whose section heading is selected, if the selection is one.

Source

pub fn selection_is_header(&self) -> bool

Source

pub fn pending_probes(&self) -> Vec<PathBuf>

Remote roots that have neither answered nor been written off.

The caller probes these off the interface thread; nothing here may touch them.

Source

pub fn below_browse_start(&self) -> bool

Whether the browsed directory is strictly below where the browse began, so Esc still has a level to climb before it returns to the listing.

Source

pub fn sections_waiting(&self) -> bool

Whether any section on screen is still waiting for its rows.

Source

pub fn awaiting_listing(&self) -> Option<&Path>

The remote location being browsed, while its listing has not come back.

Source

pub fn probe_ready(&mut self, root: PathBuf, rows: Vec<Entry>)

Record what a probe found. An empty listing is still an answer.

Source

pub fn apply_cloud_kinds(&mut self, root: &Path)

Label the rows of a cloud listing with what peeking inside them found.

Source

pub fn cloud_directories_to_peek(&self, limit: usize) -> Vec<PathBuf>

The cloud directories on or near the screen that nothing has peeked into, at most limit, the highlighted row first.

Self::unclassified_visible’s cloud twin, and deliberately the same shape: a peek is a request, and the rows worth spending one on are the rows somebody is looking at. It used to take the first forty-eight directories of each listing, once per session — so a bucket of two hundred prefixes had its first forty-eight labelled and the rest reading dir for good, however long you spent on them, while paging straight past the first forty-eight spent forty-eight requests on rows nobody saw. The cap and its never-again claim both go: the bound is what the cursor rests on.

Source

pub fn probe_failed(&mut self, root: PathBuf)

Record that a probe could not read the root.

Source

pub fn measure_now(&mut self, limit: usize) -> bool

Measure a batch of rows on the calling thread.

For tests and library callers that know their paths are safe. The application never calls this: reading a footer opens a file, which blocks on a FIFO, a device node, a wedged mount or a failing disk. In the app the interface thread only ever decides what to measure, via HomeState::unmeasured_visible, and a worker does the reading.

Source

pub fn unmeasured_visible(&self, limit: usize) -> Vec<Entry>

Rows on screen that have not been measured yet, up to limit.

The interface thread decides what is worth measuring — it knows what is visible — and a worker does the reading.

Source

pub fn classify_now(&mut self, limit: usize) -> bool

Look into a batch of rows on the calling thread.

For tests and library callers, exactly as HomeState::measure_now is, and for the same reason the application never calls it: read_dir on a wedged mount blocks, and the thread that draws must never be the one it blocks.

Source

pub fn unclassified_visible(&self, limit: usize) -> Vec<Entry>

Rows on or near the screen that nothing has looked into yet, up to limit.

HomeState::unmeasured_visible’s sibling, and deliberately a different shape. Measuring walks the list from the top, which is affordable because every row wants a count eventually and a listing of a few hundred gets there. Classifying cannot work that way: a share holding six thousand date partitions would spend ten seconds reaching the row you scrolled to, and the rows on screen are the only ones anybody is reading. So this asks the viewport, plus a screen either side so arrowing off the edge does not wait for a round trip.

The highlighted row comes first, then the rest of the screen, then the screen below, then the screen above: when the batch is smaller than the window, the buffer is what goes without.

The highlighted row first because it is the one about to be acted on. → goes inside a directory that holds one dataset and folds the section otherwise, and the control bar offers the key on the same test, so both read better for the row being looked into in the first pass rather than the third.

Source

pub fn apply_measurements(&mut self)

Fold known measurements into the rows currently listed.

Source

pub fn select_first_entry(&mut self)

Put the cursor on the first dataset rather than the first header, so the preview pane has something to show without a keypress.

Inside a directory that is the door when the door opens the directory as one dataset (see door_lands), and the first thing in it otherwise.

Source

pub fn clamp_selection(&mut self)

Source

pub fn select(&mut self, index: usize)

Put the selection on row index of what is listed, as a click does.

Source

pub fn move_selection(&mut self, delta: isize)

Source

pub fn page_selection(&mut self, delta: isize)

Move the selection delta rows, stopping at the first and last rather than wrapping. A step of one wraps, which is a quick way round; a jump of ten that wrapped landed somewhere near the top with nothing to say it had gone round.

Trait Implementations§

Source§

impl Debug for HomeState

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for HomeState

Source§

fn default() -> Self

Returns the “default value” for a type. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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<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> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T

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<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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