Skip to main content

EphemeralPool

Struct EphemeralPool 

Source
pub struct EphemeralPool {
    pub metadata: ObjectMeta,
    pub spec: PoolSpec,
    pub status: Option<PoolStatus>,
}
Expand description

Auto-generated derived type for PoolSpec via CustomResource

Fields§

§metadata: ObjectMeta§spec: PoolSpec§status: Option<PoolStatus>

Implementations§

Source§

impl EphemeralPool

Source

pub fn new(name: &str, spec: PoolSpec) -> Self

Spec based constructor for derived custom resource

Source§

impl EphemeralPool

Source

pub fn name_or_empty(&self) -> &str

Borrow-form metadata-projection primitive on the metadata.name axis of EphemeralPool: returns the K8s object name slice with the missing-name corner collapsed to the load-bearing empty-string sentinel — the ONE-liner collapse of the paired self.metadata.name.as_deref().unwrap_or("") incantation every pool-side consumer restated by hand pre-lift.

Pre-lift the .metadata.name.as_deref().unwrap_or("") chain was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-pool-reconciler, both keyed by the pool’s own name slot:

  • router::pool_name — the tie-break comparator inside best_match; a deterministic lexicographic-min-name arbiter across two pool candidates whose specificity scores tie.
  • controller_allocation::reconcile_inner — the HashMap< pool-name, Vec<PoolMember>> lookup closure fed into decide_allocation_reconcile; keys the “which pool members back this allocation candidate?” projection at every allocation-reconcile pass.

Both sites walked the SAME .as_deref().unwrap_or("") chain and both wanted the &str form the primitive returns — as a borrow suitable for lexicographic str::cmp in the tie-break AND for the HashMap<String, _>::get(&str) lookup. Post-lift each caller reaches for pool.name_or_empty() and the produced slice feeds the same downstream comparator / lookup unchanged.

The empty-string fallback is the SAME sentinel the sibling borrow-form primitive crate::crd::Process::uid_or_empty returns AND the SAME sentinel the owned-form sibling crate::crd::Process::owned_name_or_empty returns on the metadata.name axis of the sister CRD — the three primitives partition the (borrow-form × owned-form) × (uid × name) corner of the metadata-slot family on identical fallback semantics (empty string means “the slot is unset”), so a consumer that switches between the CRD surfaces based on downstream keying requirements never sees a different missing-slot spelling as a side effect.

Return-form axis: &str mirrors the borrow-first discipline of the peer metadata primitives on Process (crate::crd::Process::namespace_or_default, crate::crd::Process::name_or_placeholder, crate::crd::Process::uid_or_empty). The one missing-slot corner the chain swallowed pre-lift (missing metadata.name) collapses to the empty-string sentinel so str::is_empty / HashMap::get on an unnamed pool behaves identically to what the pre-lift .as_deref().unwrap_or("") chain produced.

A future normalization step (a name-canonicalization pass, a case-fold key builder, a per-cluster prefix stripper for cross-cluster pool-name aliasing) lands at ONE substrate method here and both downstream consumers pick up the upgrade mechanically — no per-callsite hand-edit at pool_name / reconcile_inner.

Theory anchor: THEORY.md §VI.1 (generation over composition — the .metadata.name.as_deref().unwrap_or("") chain recurred at two hand-authored sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger, and is lifted to ONE owner here). THEORY.md §II.1 invariant 5 (composition preserves proofs — the pins bind the missing-name corner + the empty-string sentinel byte-shape + the borrow-form &str lifetime + the byte-identical parity with the pre-lift chain + the fallback- value coherence with Process::uid_or_empty / Process::owned_name_or_empty on the metadata-slot × empty- sentinel axis, so a regression that drifted any surface at tests::name_or_empty_* here rather than as silent operator- facing skew between the router tie-break and the allocation member-lookup on the SAME pool candidate).

Source

pub fn owned_name_or_empty(&self) -> String

Owned-form metadata-projection primitive on the metadata.name axis of EphemeralPool: returns an owned String copy of the K8s object name with the missing-name corner collapsed to the load- bearing empty-string sentinel — the ONE-liner collapse of the paired self.metadata.name.clone().unwrap_or_default() incantation every pool-side consumer restated by hand pre-lift.

Pre-lift the .metadata.name.clone().unwrap_or_default() chain was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-pool-reconciler, both keyed by the pool’s own name slot in an owned String context:

  • controller_allocation::reconcile_inner — the HashMap<String, Vec<PoolMember>> key seed inside a pools.iter().map(|p| ...).collect() fanout; the map key is the owned String form because the produced HashMap<String, _> outlives the pool-list borrow that generated it and the downstream pool_members.get(pool.name_or_empty()) closure consumes it as &str.
  • allocation_decide::AllocationConvergenceCtx::observe — the AllocationRef::name slot seed stamped on the matched-pool handle; the struct literal is AllocationRef { name: String, namespace: String } and the produced value is threaded through the Decision::decide transition rule downstream.

Both sites walked the SAME .clone().unwrap_or_default() chain and both wanted the String form the primitive returns — as the owned key of a HashMap<String, _> and as the String slot of an AllocationRef struct literal. Post-lift each callsite reads pool.owned_name_or_empty() and the produced value feeds the same downstream key / struct-literal slot unchanged.

The empty-string fallback is the SAME sentinel the sibling borrow-form primitive Self::name_or_empty returns AND the SAME sentinel the sibling owned-form primitive crate::crd::Process::owned_name_or_empty returns on the metadata.name axis of the sister CRD — the three primitives partition the (borrow-form × owned-form) corner of the metadata- name family across BOTH tatara-process CRDs on identical missing- slot semantics (empty string means “the slot is unset”), so a consumer that switches between the CRD surfaces based on downstream ownership requirements never sees a different missing-slot spelling as a side effect.

Peer to Self::name_or_empty on the (return-form × ownership) axis pair — closes the corner the pool-side family previously left open:

  • borrow + empty sentinel → Self::name_or_empty (router tie- break comparator, HashMap<String, _>::get(&str) lookup — consumers whose downstream keys by &str and allocates nothing);
  • owned + empty sentinel → this method (HashMap-key seed in an outliving-borrow context, AllocationRef::name struct- literal slot — consumers whose downstream requires the owned String form because the produced value outlives the source- pool borrow).

A future normalization step (a name-canonicalization pass, a case-fold key builder, a per-cluster prefix stripper for cross- cluster pool-name aliasing) lands at ONE substrate method here and both downstream consumers pick up the upgrade mechanically — no per-callsite hand-edit at reconcile_inner / AllocationConvergenceCtx::observe.

Theory anchor: THEORY.md §VI.1 (generation over composition — the .metadata.name.clone().unwrap_or_default() chain recurred at two hand-authored sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger, and is lifted to ONE owner here). THEORY.md §II.1 invariant 5 (composition preserves proofs — the pins bind the missing-name corner + the empty-string sentinel byte-shape + the owned-form String return type + the byte-identical parity with the pre-lift chain + the fallback- value coherence with Self::name_or_empty + crate::crd::Process::owned_name_or_empty on the metadata- slot × empty-sentinel axis, so a regression that drifted any surface at tests::owned_name_or_empty_* here rather than as silent operator-facing skew between the pool-members lookup key and the AllocationRef seed on the SAME pool candidate).

Source

pub fn is_being_deleted(&self) -> bool

Copy-form metadata-projection primitive on the deletion-tombstone axis of EphemeralPool: returns true iff the K8s API server has stamped a metadata.deletionTimestamp on this pool (the moment the object entered the “being deleted” corner of its lifecycle, after which further mutating writes are refused and finalizers are drained before the object is actually removed) — the ONE-liner collapse of the paired self.metadata.deletion_timestamp.is_some() incantation every pool-side consumer restated by hand pre-lift.

Pre-lift the .metadata.deletion_timestamp.is_some() chain was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-pool-reconciler, both projecting the SAME tombstone-presence predicate on an EphemeralPool value:

  • pool_decide::decide_pool_reconcile — the pure decision function’s deletion-preempt gate that forces [PoolDecision::Drain] as soon as the API server stamps the tombstone, before the (desired vs actual) supply-arithmetic branches get a chance to run. Wired at the very top of the decision so a draining pool never spawns / reaps / expires through the normal replenishment arithmetic while the deletion is in flight.
  • controller_pool::pool_phase_from_members — the observed- phase composer’s tombstone-first arm that returns PoolPhase::Draining regardless of the supply / demand arithmetic that would otherwise pick Ready / Scaling / Degraded. Keeps the reported phase honest during the finalizer drain so operators reading kubectl get ephemeralpools see the tombstone-present state as Draining, not as a stale Ready.

Both sites walked the SAME .metadata.deletion_timestamp .is_some() chain and both wanted the bool form the primitive returns — the decide_pool_reconcile site to gate the → Drain short-circuit and the pool_phase_from_members site to gate the → Draining short-circuit. Post-lift each callsite reads pool.is_being_deleted() and the produced bool feeds the same downstream short-circuit unchanged.

Sibling to crate::crd::Process::is_being_deleted on the deletion-tombstone axis of the sister CRD — the two primitives now partition the tombstone-presence probe across BOTH tatara-process CRDs on identical missing-slot semantics (present timestamp means “the API server has begun deletion”), so an operator or reconciler that switches between the CRD surfaces never sees a different tombstone-detection spelling as a side effect.

Return-form axis: bool matches the copy-form discipline of the sibling crate::crd::Process::is_being_deleted and of the pool-side crate::phase::ProcessPhase::is_alive + Self::name_or_empty-family primitives — the underlying slot is a wire-format Option<Time> that carries only presence information at this axis (the RFC-3339 timestamp payload itself is not what the two consumers read; both only probe presence to detect the tombstone-stamped state). Returning the raw Option<&Time> would push the .is_some() probe back to every callsite, restating the pre-lift chain one link shorter without collapsing the primitive.

Peer to Self::name_or_empty and Self::owned_name_or_empty on the metadata-projection axis for EphemeralPool; this method opens the presence-probe corner for the tombstone slot. Future metadata-presence projections on the pool CRD (an is_being_finalized projection on metadata.finalizers.is_empty()’s negation, a has_owner projection on metadata.owner_references.is_empty()’s negation) land as peer methods on this same axis.

A future normalization step (a per-tombstone staleness gate that returns false for a tombstone older than the reconciler’s grace-period budget, a canonicalization pass that treats a tombstone from a paused controller as absent, a cross-cluster tombstone-observation clock skew guard) lands at ONE substrate method here and both downstream consumers pick up the upgrade mechanically — no per-callsite hand-edit at decide_pool_reconcile / pool_phase_from_members.

Theory anchor: THEORY.md §VI.1 (generation over composition — the .metadata.deletion_timestamp.is_some() chain recurred at two hand-authored sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger, and is lifted to ONE owner here). THEORY.md §II.1 invariant 5 (composition preserves proofs — the pins bind the missing-tombstone corner + the present- tombstone corner + the copy-form bool return + the byte- identical parity with the pre-lift .is_some() chain + the cross-CRD coherence with crate::crd::Process::is_being_deleted on the tombstone axis, so a regression that drifted any surface at tests::is_being_deleted_* rather than as silent operator- facing skew between the pool-reconciler’s → Drain decision and the observed-phase composer’s → Draining report on the SAME EphemeralPool within one reconcile pass).

Trait Implementations§

Source§

impl Clone for EphemeralPool

Source§

fn clone(&self) -> EphemeralPool

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 CustomResourceExt for EphemeralPool

Source§

fn crd() -> CustomResourceDefinition

Helper to generate the CRD including the JsonSchema Read more
Source§

fn crd_name() -> &'static str

Helper to return the name of this CustomResourceDefinition in kubernetes. Read more
Source§

fn api_resource() -> ApiResource

Helper to generate the api information type for use with the dynamic Api
Source§

fn shortnames() -> &'static [&'static str]

Shortnames of this resource type. Read more
Source§

impl Debug for EphemeralPool

Source§

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

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

impl<'de> Deserialize<'de> for EphemeralPool

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 HasSpec for EphemeralPool

Source§

type Spec = PoolSpec

The type of the spec of this resource
Source§

fn spec(&self) -> &PoolSpec

Returns a reference to the spec of the object
Source§

fn spec_mut(&mut self) -> &mut PoolSpec

Returns a mutable reference to the spec of the object
Source§

impl HasStatus for EphemeralPool

Source§

type Status = PoolStatus

The type of the status object
Source§

fn status(&self) -> Option<&PoolStatus>

Returns an optional reference to the status of the object
Source§

fn status_mut(&mut self) -> &mut Option<PoolStatus>

Returns an optional mutable reference to the status of the object
Source§

impl JsonSchema for EphemeralPool

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 Resource for EphemeralPool

Source§

type DynamicType = ()

Type information for types that do not know their resource information at compile time. Read more
Source§

type Scope = NamespaceResourceScope

Type information for the api scope of the resource when known at compile time Read more
Source§

fn group(_: &()) -> Cow<'_, str>

Returns group of this object
Source§

fn kind(_: &()) -> Cow<'_, str>

Returns kind of this object
Source§

fn version(_: &()) -> Cow<'_, str>

Returns version of this object
Source§

fn api_version(_: &()) -> Cow<'_, str>

Returns apiVersion of this object
Source§

fn plural(_: &()) -> Cow<'_, str>

Returns the plural name of the kind Read more
Source§

fn meta(&self) -> &ObjectMeta

Metadata that all persisted resources must have
Source§

fn meta_mut(&mut self) -> &mut ObjectMeta

Metadata that all persisted resources must have
Source§

fn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String

Creates a url path for http requests for this resource
Source§

fn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference

Generates an object reference for the resource
Source§

fn controller_owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>

Generates a controller owner reference pointing to this resource Read more
Source§

fn owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>

Generates an owner reference pointing to this resource Read more
Source§

impl Serialize for EphemeralPool

Source§

fn serialize<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error>

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<K> Lookup for K
where K: Resource,

Source§

type DynamicType = <K as Resource>::DynamicType

Type information for types that do not know their resource information at compile time. This is equivalent to Resource::DynamicType.
Source§

fn kind(dyntype: &<K as Lookup>::DynamicType) -> Cow<'_, str>

The kind for this object.
Source§

fn version(dyntype: &<K as Lookup>::DynamicType) -> Cow<'_, str>

The version for this object.
Source§

fn group(dyntype: &<K as Lookup>::DynamicType) -> Cow<'_, str>

The group for this object.
Source§

fn plural(dyntype: &<K as Lookup>::DynamicType) -> Cow<'_, str>

The plural for this object.
Source§

fn name(&self) -> Option<Cow<'_, str>>

The name of the object.
Source§

fn namespace(&self) -> Option<Cow<'_, str>>

The namespace of the object.
Source§

fn resource_version(&self) -> Option<Cow<'_, str>>

The resource version of the object.
Source§

fn uid(&self) -> Option<Cow<'_, str>>

The UID of the object.
Source§

fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>

The apiVersion for this object.
Source§

fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>

Constructs an ObjectRef for this object.
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<K> ResourceExt for K
where K: Resource,

Source§

fn name_unchecked(&self) -> String

Returns the name of the resource, panicking if it is unset Read more
Source§

fn name_any(&self) -> String

Returns the most useful name identifier available Read more
Source§

fn namespace(&self) -> Option<String>

The namespace the resource is in
Source§

fn resource_version(&self) -> Option<String>

The resource version
Source§

fn uid(&self) -> Option<String>

Unique ID (if you delete resource and then create a new resource with the same name, it will have different ID)
Source§

fn creation_timestamp(&self) -> Option<Time>

Returns the creation timestamp Read more
Source§

fn labels(&self) -> &BTreeMap<String, String>

Returns resource labels
Source§

fn labels_mut(&mut self) -> &mut BTreeMap<String, String>

Provides mutable access to the labels
Source§

fn annotations(&self) -> &BTreeMap<String, String>

Returns resource annotations
Source§

fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>

Provider mutable access to the annotations
Source§

fn owner_references(&self) -> &[OwnerReference]

Returns resource owner references
Source§

fn owner_references_mut(&mut self) -> &mut Vec<OwnerReference>

Provides mutable access to the owner references
Source§

fn finalizers(&self) -> &[String]

Returns resource finalizers
Source§

fn finalizers_mut(&mut self) -> &mut Vec<String>

Provides mutable access to the finalizers
Source§

fn managed_fields(&self) -> &[ManagedFieldsEntry]

Returns managed fields
Source§

fn managed_fields_mut(&mut self) -> &mut Vec<ManagedFieldsEntry>

Provides mutable access to managed fields
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, <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<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