Skip to main content

PoolSpec

Struct PoolSpec 

Source
pub struct PoolSpec {
    pub desired_size: u32,
    pub min_size: u32,
    pub max_size: u32,
    pub return_policy: ReturnPolicy,
    pub selector: PoolSelector,
    pub template: EphemeralSpec,
    pub free_ttl: String,
    pub max_allocation_ttl: String,
    pub desired: u32,
    pub replacement_policy: ReplacementPolicy,
    pub stable_name_claim: bool,
}
Expand description

EphemeralPool CRD spec — typed pool of warm Processes.

apiVersion: tatara.pleme.io/v1alpha1
kind: EphemeralPool
metadata:
  name: attest-pool
  namespace: ephemeral-pools
spec:
  desiredSize: 3
  minSize: 1
  maxSize: 5
  returnPolicy: Reset
  selector:
    repos: ["pleme-io/demo-*"]
    branches: ["main", "release-*"]
    prLabels: ["needs-ephemeral"]
  template:
    aplicacao:
      chartRef: "oci://ghcr.io/pleme-io/charts/lareira-demo-app"
      version: "0.5.5"
      profile: "all-in-one"
      …
    ttl: "2h"
    teardown: OnAttested
    postconditions: [ … ]

Fields§

§desired_size: u32

Target number of warm Processes the pool maintains in Free state (sum of Free + Spawning targets desired_size).

§min_size: u32

Hard floor on the free count. The reconciler refuses to scale below this even on cost-pressure signals. Default = 0.

§max_size: u32

Hard ceiling on total pool members (free + allocated + spawning). 0 = no cap. Default = 0.

§return_policy: ReturnPolicy

What to do when an allocation releases.

§selector: PoolSelector

Routing selector — which allocation requests this pool serves. The reconciler matches incoming EphemeralAllocation CRs against this selector (most-specific wins across pools sharing a namespace).

§template: EphemeralSpec

Template for each pool member — a typed EphemeralSpec that the reconciler lowers to ProcessSpec and instantiates. While in the free list each member’s lifetime is overridden to Permanent; allocation flips it back to Ephemeral with the requestor’s TTL.

§free_ttl: String

How long a pool member may sit in Free before the reconciler recycles it (humantime). Defends against drift / stale state. Default "24h".

§max_allocation_ttl: String

Max time the reconciler allows a single allocation to hold a member before forcibly returning it (humantime). Hard cap independent of the allocation’s own TTL. Default "4h".

§desired: u32

R5 desired-count loop — when set non-zero, the pool reconciler maintains exactly this many healthy (Running or Attested) Processes regardless of allocation pressure. Drives the “always seeking stability” property: failed members are replaced per replacement_policy. 0 keeps the legacy allocation-driven sizing (desired = floor of free + allocated).

Operator usage: desired: 5 means “always have 5 of these running”; failures auto-replace.

§replacement_policy: ReplacementPolicy

R5 — what the pool reconciler does when a member reaches Failed phase.

§stable_name_claim: bool

R5 — when true, exactly one healthy member of the pool holds the unprefixed-form DNS hostnames declared in template.routing at any moment. The claim arbiter (see tatara-reconciler::claim) transfers atomically when the holder fails.

Implementations§

Source§

impl PoolSpec

Source

pub fn free_ttl_duration(&self) -> Option<Duration>

Humantime-parsed std::time::Duration projection of the Self::free_ttl slot — the ONE-line collapse of the paired humantime::parse_duration(&<pool>.spec.free_ttl).ok() incantation the pool reconciler’s stale-free bucket loop hand-authored pre-lift, sibling to crate::lifetime::EphemeralLifetime::ttl_duration on the SAME (humantime string field × Option<Duration>) → Option< Duration> substrate axis.

Pre-lift the humantime::parse_duration(&<field>).ok() shape was owned at ONE substrate primitive on crate::lifetime::EphemeralLifetime (the spec.lifetime .ephemeral.ttl axis, feeding crate::lifetime_clock::evaluate’s TTL-expiry gate + the requeue_with_ttl sleep-budget picker) AND hand-authored at ONE peer consumer site — tatara-pool-reconciler::pool_decide ::decide_pool, which parses pool.spec.free_ttl with the byte-identical shape (humantime::parse_duration(&spec .free_ttl).unwrap_or_default()) and gates the stale-free bucket loop on the result. That’s ONE substrate owner + ONE hand-authored chain on a peer humantime field of a peer spec type past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger — two surfaces spelling the SAME projection with the SAME drift risk (a per-fleet minimum TTL floor before the humantime cast, a canonical unit-normalization pass, a warn-log on unparseable strings would have had to land at every surface plus stay coherent between them).

Post-lift both peer humantime fields (crate::lifetime::EphemeralLifetime::ttl + Self::free_ttl) publish the SAME shape at TWO peer inherent methods on peer spec types — the tatara-pool- reconciler’s stale-free bucket loop reads pool.spec.free_ttl _duration().unwrap_or_default() and the produced [std::time ::Duration] feeds the same !free_ttl.is_zero() guard + elapsed > free_ttl comparator unchanged. A future normalization (per-fleet minimum floor, canonical unit normalization, warn-log on unparseable strings) lands at TWO substrate methods here + on crate::lifetime::EphemeralLifetime::ttl_duration, reachable via ONE workspace-wide sweep across the peer axis rather than as a per-callsite hand-edit at every downstream humantime-ttl consumer.

Return-form axis: Option<std::time::Duration> matches the peer primitive on crate::lifetime::EphemeralLifetime::ttl_duration and the downstream comparator’s type. The peer projection crate::time::elapsed_since returns the SAME Option<std ::time::Duration> shape, so the stale-free gate’s elapsed > free_ttl comparator lands with both operands on the same axis without a per-consumer conversion step.

The None arm is the “operator’s free_ttl string doesn’t parse” corner — a typo ("1our"), an unsupported unit, a non-humantime literal that reached the field. The pool reconciler’s stale-free bucket loop collapses the corner via .unwrap_or_default(), yielding the Duration::ZERO value that already gates its follow-on !free_ttl.is_zero() check — post-lift semantics is byte-identical to the pre-lift hand-authored humantime::parse_duration(&spec.free_ttl) .unwrap_or_default() shape.

Theory anchor: THEORY.md §VI.1 (generation over composition — the humantime::parse_duration(&<field>).ok() shape recurred at ONE substrate owner + ONE hand-authored peer site past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger, and is lifted onto TWO peer inherent methods on peer spec types here + on crate::lifetime::EphemeralLifetime::ttl_duration). THEORY.md §II.1 invariant 5 (composition preserves proofs — the pins below bind the parse-failure corner, the empty-ttl corner, the humantime edge shapes, the return-form parity with crate::lifetime::EphemeralLifetime::ttl_duration, and the byte-identical parity with the pre-lift .ok() chain on the SAME spec.free_ttl value, so a regression that drifts any surface fails at tests::pool_spec_free_ttl_duration_* here rather than as silent operator-facing skew between the pool stale-free bucket loop and the ephemeral TTL-expiry gate on the two peer humantime-string fields).

Source

pub fn with_template(template: EphemeralSpec) -> Self

Compose a PoolSpec for the given member template, stamping every non-template slot at the #[serde(default …)] value the wire-schema publishes above — the ONE substrate composer that closes the 11-slot PoolSpec { desired_size: 1, min_size: 0, max_size: 0, return_policy: ReturnPolicy::Replace, selector: PoolSelector::default(), template, free_ttl: "24h".into(), max_allocation_ttl: "4h".into(), desired: 0, replacement_policy: Default::default(), stable_name_claim: false } struct-literal every test-side + reconciler-side seed hand-authored pre-lift.

Sibling to crate::crd::ProcessSpec::gate_compute_defaults on the (spec-type × full-baseline-composer) axis — that primitive owns the 11-slot crate::crd::ProcessSpec baseline composer; this one owns the peer 11-slot PoolSpec baseline composer. Both take a caller-supplied slot (there: the classification baseline via Classification::gate_compute(); here: the template EphemeralSpec, which has no natural default) and fill every other slot at its wire-published default so a caller composes with struct-update syntax (PoolSpec { desired_size: 1, ..PoolSpec::with_template(empty_template()) }) rather than re-spelling the 10 defaulted slots at every seed. A future promotion of a defaulted slot to a non-default (a per-fleet minimum min_size floor, a shifted default_free_ttl, a widened ReturnPolicy default) lands at ONE substrate composer here and every downstream seed inherits the upgrade mechanically.

Pre-lift the 11-slot struct-literal was hand-authored at EIGHT sites across TWO crates past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger:

  • tatara-process::lib::tests::pool_fixture — the qualified_process_ref + trait-pin fixture seed;
  • tatara-process::lib::tests::empty_pool_spec (×2) — the two sibling fixtures inside separate pin modules;
  • tatara-process::pool::tests::pool_spec — the name_or_empty / namespace_or_empty pin fixture;
  • tatara-pool-reconciler::router::tests::pool — the router- candidate-arbiter pin fixture (overrides selector);
  • tatara-pool-reconciler::desired::tests::pool_with_desired — the desired-count-loop pin fixture (overrides desired + replacement_policy);
  • tatara-pool-reconciler::pool_decide::tests::pool — the pure-decision pin fixture (overrides sizes);
  • tatara-pool-reconciler::allocation_decide::tests::pool — the allocation-router pin fixture (overrides selector).

The three fields the wire-schema does NOT default (desired_size carries no #[serde(default)] above; template is the caller- supplied slot) are stamped at their operator-friendly seed values here — desired_size = 0 matches every other reset slot’s 0 / false / Default stamp, so a caller can compose PoolSpec { desired_size: 1, ..PoolSpec::with_template(t) } for the single-slot pool the majority of pre-lift seeds spelled, or PoolSpec { desired_size: 0, desired: 5, ..with_template(t) } for the desired-count-loop shape one seed spelled.

Theory anchor: THEORY.md §VI.1 (generation over composition — the 11-slot PoolSpec struct-literal recurred at EIGHT hand- authored sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger and is lifted onto ONE workspace-wide owner here). THEORY.md §II.1 invariant 5 (composition preserves proofs — a regression that drifted a wire-published default at only one consumer, or that broke the sibling-default correspondence with crate::crd::ProcessSpec::gate_compute_defaults, surfaces at this primitive’s tests rather than as silent operator-visible skew across the eight fixtures whose assertions key on the shape).

Trait Implementations§

Source§

impl Clone for PoolSpec

Source§

fn clone(&self) -> PoolSpec

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 PoolSpec

Source§

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

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

impl<'de> Deserialize<'de> for PoolSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for PoolSpec

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for PoolSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> AppData for T
where T: OptionalSend + OptionalSync + 'static + OptionalSerde,

Source§

impl<T> AppDataResponse for T
where T: OptionalSend + OptionalSync + 'static + OptionalSerde,

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

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

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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

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

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

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

impl<T> OptionalSend for T
where T: Send + ?Sized,

Source§

impl<T> OptionalSync for T
where T: Sync + ?Sized,

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

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