Skip to main content

Timings

Struct Timings 

Source
pub struct Timings {
Show 87 fields pub tick_interval: Duration, pub heartbeat_interval: Duration, pub lease_timeout: Duration, pub script_root_grace: Duration, pub event_lookback: Duration, pub lease_period: Duration, pub read_back_window: Duration, pub read_back_interval: Duration, pub query_timeout: Duration, pub loop_stall_timeout: Duration, pub set_aside: Duration, pub handed_call_min: Duration, pub cleanup_move_wait: Duration, pub listen_retry: Duration, pub refresh_interval: Duration, pub worker_connect_timeout: Duration, pub drain_report_period: Duration, pub memory_check_interval: Duration, pub handshake_timeout: Duration, pub output_drain_timeout: Duration, pub fork_answer_timeout: Duration, pub fork_backoff_first: Duration, pub fork_backoff_max: Duration, pub fork_backoff_reset_after: Duration, pub log_sweep_interval: Duration, pub orphan_poll: Duration, pub orphan_kill_wait: Duration, pub orphan_grace: Duration, pub reconnect_backoff_first: Duration, pub reconnect_backoff_max: Duration, pub worker_alive_interval: Duration, pub deregister_wait: Duration, pub drain_tick: Duration, pub drain_ack_wait: Duration, pub stop_poll: Duration, pub connection_job_cancel_grace: Duration, pub vault_min_renew_wait: Duration, pub master_sample_window: Duration, pub clock_skew_warning: Duration, pub vault_renew_check: Duration, pub vault_renew_retry: Duration, pub round_gap: Duration, pub notification_retry: Duration, pub master_alive_interval: Duration, pub gauge_refresh: Duration, pub outbox_poll: Duration, pub outbox_retry_first: Duration, pub outbox_retry_max: Duration, pub retention_interval: Duration, pub sample_interval: Duration, pub samples_kept: Duration, pub rollups_kept: Duration, pub parse_retry_first: Duration, pub parse_retry_max: Duration, pub node_heartbeat: Duration, pub changes_poll_interval: Duration, pub events_recheck: Duration, pub events_keep_alive: Duration, pub events_retry: Duration, pub auth_recheck: Duration, pub auth_remembered: Duration, pub requests_grace: Duration, pub schema_retry: Duration, pub ui_keep_alive: Duration, pub ui_coalesce: Duration, pub ui_tail_interval: Duration, pub ui_tail_give_up: Duration, pub ui_slow_read: Duration, pub ui_slow_read_wait: Duration, pub ui_relay_retry_first: Duration, pub ui_relay_retry_max: Duration, pub worker_stop_after_failure: Duration, pub accept_retry: Duration, pub trigger_restart_backoff: Duration, pub trigger_restart_backoff_max: Duration, pub metrics_final_after: Duration, pub sample_rollup_grace: Duration, pub memory_peaks_window: Duration, pub event_future_tolerance: Duration, pub for_future_tolerance: Duration, pub code_retry_delay: Duration, pub node_row_kept: Duration, pub client_connect_timeout: Duration, pub client_request_timeout: Duration, pub client_command_wait: Duration, pub dags_test_run_timeout: Duration, pub overridden: Vec<String>,
}
Expand description

The timings that aren’t a user’s to choose, each tuned, tied to others, or what the cluster’s correctness depends on (a wrong value can run tasks twice, or lose a healthy worker): fixed, not configuration. Only SCHEDR_HIDDEN__* changes them, which is what the tests do, to run in seconds; anyone else does so at their own risk.

Fields§

§tick_interval: Duration

How often the master’s loop runs (scheduler, commands, dispatching).

§heartbeat_interval: Duration

How often workers send Heartbeat (the master’s setting, sent to every worker).

§lease_timeout: Duration

A worker silent for this long is lost.

§script_root_grace: Duration

How long no alive worker must report a script root before DAG roots using it are no longer withdrawn for it (decision 303).

§event_lookback: Duration

How far before the newest event an EventNamed trigger acted on it looks again, for one stored late (decision 354: a post’s time is taken before it commits, and webservers’ clocks differ); the keys its DAG has are skipped. Longer than a query_timeout and the webservers’ clock skew.

§lease_period: Duration

How long the master’s lease lasts (one master per database: a second one waits as a standby, and takes over at most this long after the first dies); renewed every third of it. At least three query_timeouts, shorter than loop_stall_timeout.

§read_back_window: Duration

After a commit cut off by the time limit or a lost connection, how long the master reads back whether it was stored (holding its lock: rounds and worker messages wait). Not seen by then: taken as not stored.

§read_back_interval: Duration

How often it reads back within read_back_window.

§query_timeout: Duration

The longest a query (or waiting for a connection) may take; a write’s transaction, a few of these. Shorter than loop_stall_timeout, so one hung query doesn’t look like a stuck loop, and at most a third of lease_period.

§loop_stall_timeout: Duration

The master’s liveness fails when its scheduling loop hasn’t started an iteration for this long.

§set_aside: Duration

How long a task whose assignment fails on its own (its data won’t read, the database refuses it) is left out of the rounds, so the others go on, before it is tried again.

§handed_call_min: Duration

The least an @sensor(wait_for=...)’s call gets once it is handed its run, though its max_wait is nearly or already out: the run ended within it (decision 353).

§cleanup_move_wait: Duration

How long a lost worker’s cleanup waits, on top of the cancel grace, before it moves: a worker only cut off has stopped the task by then (decision 256).

§listen_retry: Duration

How often a master whose listening for commands failed to start (the database too slow to check for a pooler, or unreachable) tries again; it polls meanwhile.

§refresh_interval: Duration

How often the web UI’s live pages are told to read themselves again when the database’s changes can’t be followed ([database] change_notifications = false, or no listening connection).

§worker_connect_timeout: Duration

How long connecting to a worker may take, to fetch a task’s log. Raise it on a slow network between the webserver and the workers.

§drain_report_period: Duration

From a drain’s SIGKILL of the tasks still running to the end of termination_grace_period: time to report them interrupted and deregister before the pod is killed (with 0s, their results may not reach the master, and they end lost).

§memory_check_interval: Duration

How often the watchdog samples each task’s memory.

§handshake_timeout: Duration

How long a peer has to complete the TLS handshake. Raise it for slow clients; lower it to drop stalled connections sooner.

§output_drain_timeout: Duration

How long a stopped process’s output may take to reach its log (a process it started in a session of its own can hold the pipes open).

§fork_answer_timeout: Duration

How long a fork server may take to answer a request; then it is restarted, and the task spawned.

§fork_backoff_first: Duration

The first wait before a fork server is restarted; it doubles up to fork_backoff_max.

§fork_backoff_max: Duration

The longest wait before a fork server is restarted.

§fork_backoff_reset_after: Duration

A fork server up for this long starts its restarts’ waits over.

§log_sweep_interval: Duration

How often old task logs are swept.

§orphan_poll: Duration

How often an orphan found at start is looked at while it stops.

§orphan_kill_wait: Duration

How long an orphan may take to go after SIGKILL.

§orphan_grace: Duration

How long an orphan found at start gets from SIGTERM to SIGKILL.

§reconnect_backoff_first: Duration

The first wait after the master connection drops; it doubles up to reconnect_backoff_max, with jitter.

§reconnect_backoff_max: Duration

The longest wait between tries to reach the master.

§worker_alive_interval: Duration

How often the agent’s loop turns at least, however quiet. Shorter than loop_stall_timeout, or a quiet agent looks stuck.

§deregister_wait: Duration

How long a stopping worker waits for the master to take its deregistering, at most (the drain’s end bounds it; by default that end alone, B242).

§drain_tick: Duration

How often a drain looks at what is left.

§drain_ack_wait: Duration

How long a drained worker waits for the master to acknowledge its last results; never past half the report period before the grace period ends, left to deregister and exit.

§stop_poll: Duration

How often a stopped task’s process group is looked at until it is gone.

§connection_job_cancel_grace: Duration

How long a connection test’s process gets from SIGTERM to SIGKILL.

§vault_min_renew_wait: Duration

A Vault token’s renewal never comes sooner than this.

§master_sample_window: Duration

How far back a worker looks for its tightest master-time sample (decision 447).

§clock_skew_warning: Duration

How far apart the master’s wall clock and a worker’s may be, beyond the round trip, before the worker warns (decision 449, B232).

§vault_renew_check: Duration

How often a Vault session with nothing to renew is looked at again.

§vault_renew_retry: Duration

How soon a failed Vault renewal is tried again, while the token lasts.

§round_gap: Duration

At most one extra round every this long, under a stream of finished tasks.

§notification_retry: Duration

After notifications failed, how long until they are tried again; polling goes on meanwhile.

§master_alive_interval: Duration

How often the master’s loop turns at least while it waits. Shorter than loop_stall_timeout, or a waiting master looks stuck.

§gauge_refresh: Duration

How often the master’s gauges are read from the database.

§outbox_poll: Duration

How often the master’s sender looks for notifications to deliver.

§outbox_retry_first: Duration

The first wait before a notification that failed is tried again; it doubles up to outbox_retry_max.

§outbox_retry_max: Duration

The longest wait before a notification that failed is tried again.

§retention_interval: Duration

How often the master’s retention job deletes what [retention] no longer keeps (decision 432).

§sample_interval: Duration

How often the leading master samples each process, and a webserver itself (decision 464).

§samples_kept: Duration

How long the minute samples are kept.

§rollups_kept: Duration

How long the 15-minute rollups are kept.

§parse_retry_first: Duration

The first wait before a failed parse job is tried again; it doubles up to parse_retry_max.

§parse_retry_max: Duration

The longest wait before a failed parse job is tried again.

§node_heartbeat: Duration

How often a master writes its row of the deployment’s nodes.

§changes_poll_interval: Duration

How often changes are read where they aren’t announced (SQLite).

§events_recheck: Duration

How often the webserver looks at whether the database announces its changes.

§events_keep_alive: Duration

How often an event stream gets a comment, keeping idle connections open through proxies.

§events_retry: Duration

How soon following the database’s changes is tried again after a failure.

§auth_recheck: Duration

How often the users and token files are looked at for a change. A removed user or a changed password keeps working this long: raising it delays revocation.

§auth_remembered: Duration

How long a password check that passed is remembered, instead of running bcrypt again. A change of the users file forgets them all.

§requests_grace: Duration

How long running requests get once the server stops; then they are cut.

§schema_retry: Duration

How often a webserver started before the migration looks again.

§ui_keep_alive: Duration

How often a page’s stream gets a ping, and the log tail a comment.

§ui_coalesce: Duration

A page’s stream sends at most one change this often, per deployment.

§ui_tail_interval: Duration

How often the log tail reads the log.

§ui_tail_give_up: Duration

How long the log tail keeps trying a log out of reach before it says so and stops.

§ui_slow_read: Duration

A Runs page read that took longer than this is slow (its deployments’ answers).

§ui_slow_read_wait: Duration

After a slow read, the page reads again on a change at most this often.

§ui_relay_retry_first: Duration

The first wait before a relay opens its stream again; it doubles up to relay_retry_max.

§ui_relay_retry_max: Duration

The longest wait between a relay’s tries.

§worker_stop_after_failure: Duration

Once a standalone’s master failed, how long its worker gets to stop.

§accept_retry: Duration

How long a listener waits after a failed accept (too many open files), instead of spinning.

§trigger_restart_backoff: Duration

The wait before a failed trigger starts again; it doubles with each failure in a row.

§trigger_restart_backoff_max: Duration

The most it waits.

§metrics_final_after: Duration

How long after its end a Metrics bucket is final, kept by the webserver between requests (decision 492): longer than the rollup’s grace, with room for the writers’ clocks. (WEBSERVER__METRICS_FINAL_AFTER)

§sample_rollup_grace: Duration

How long after its end a samples window waits to be rolled up, so a sample stored late is in it; shorter than metrics_final_after. (MASTER__SAMPLE_ROLLUP_GRACE)

§memory_peaks_window: Duration

How far back the DAG page’s memory p95s reach (decision 467). (WEBSERVER__MEMORY_PEAKS_WINDOW)

§event_future_tolerance: Duration

How far ahead of the clock a posted event’s at may be, posted to a webserver or by a task through its master (EVENTS__FUTURE_TOLERANCE).

§for_future_tolerance: Duration

How far ahead of the master’s clock a run’s --for may be. (MASTER__FOR_FUTURE_TOLERANCE)

§code_retry_delay: Duration

When a task whose code wasn’t on its worker yet is tried again: about a git-sync interval and the settle time. (MASTER__CODE_RETRY_DELAY)

§node_row_kept: Duration

How long a master’s row stays after its last heartbeat before it is removed. (MASTER__NODE_ROW_KEPT)

§client_connect_timeout: Duration

How long the CLI and schedr ui wait to connect to a webserver. (CLIENT__CONNECT_TIMEOUT)

§client_request_timeout: Duration

How long one request of the CLI or schedr ui to a webserver may take. (CLIENT__REQUEST_TIMEOUT)

§client_command_wait: Duration

How long the CLI and schedr ui wait for the master’s decision on a command. (CLIENT__COMMAND_WAIT)

§dags_test_run_timeout: Duration

How long schedr dags test waits for its run. (DAGS__TEST_RUN_TIMEOUT)

§overridden: Vec<String>

The SCHEDR_HIDDEN__* variables set, each warned about when starting.

Trait Implementations§

Source§

impl Clone for Timings

Source§

fn clone(&self) -> Timings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Timings

Source§

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

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

impl Default for Timings

Source§

fn default() -> Self

The values every deployment runs with.

Source§

impl Eq for Timings

Source§

impl PartialEq for Timings

Source§

fn eq(&self, other: &Timings) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Timings

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

§

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

§

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();
§

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

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

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

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

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

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

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));
§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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();
§

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

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

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

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

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

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

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));
§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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();
§

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

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

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

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

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

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

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

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

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

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());
§

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

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

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

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

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

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

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

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

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

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();
§

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

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

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

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

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

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

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

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

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

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());
§

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

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

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

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

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

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

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

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

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

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);
§

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

Create a new [Painted] with a default [Style]. Read more
§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.