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

Source

pub fn owned_namespace_or_empty(&self) -> String

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

Pre-lift the .metadata.namespace.clone().unwrap_or_default() chain was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold, both stamping the AllocationRef { namespace: String, .. } slot inside an owned-String context:

  • tatara-pool-reconciler::allocation_decide::AllocationConvergenceCtx ::observe — the matched-pool seed’s AllocationRef.namespace slot, right beside the peer Self::owned_name_or_empty call that owns the paired name half. This is the exact site the pre-existing peer-primitive doc-comment forecast ("a future run may lift owned_namespace_or_empty as the sibling axis peer").
  • crate::pool::tests::allocation_ref_new_composes_with_owned_name_or_empty_pool_projection — the composition pin that seeded an AllocationRef from the same paired-primitive-half construction the production consumer in allocation_decide::observe performs. Post-lift the pin composes two peer primitives (owned_name_or_empty + owned_namespace_or_empty) rather than one primitive plus the pre-lift chain, sharpening it from a mixed-form composition check into a paired-primitive-family composition check.

Both sites walked the SAME .clone().unwrap_or_default() chain and both wanted the String form the primitive returns — as the String slot of an AllocationRef struct literal built through crate::pool::AllocationRef::new. Post-lift each callsite reads pool.owned_namespace_or_empty() and the produced value feeds the same downstream AllocationRef slot unchanged.

The empty-string fallback is the SAME sentinel the sibling owned- form primitive Self::owned_name_or_empty returns on the metadata.name axis of the same CRD — the two primitives now partition the (owned String × metadata.<slot>) corner of the pool CRD’s metadata family across BOTH object-coordinate slots on identical missing-slot semantics (empty string means “the slot is unset”), so the crate::pool::AllocationRef::new composer sees a coherent owned-empty pair regardless of which slot is absent on the source pool. Coherent with the workspace- wide owned-empty sentinel that the peer primitives crate::crd::Process::uid_or_empty, crate::crd::Process::owned_name_or_empty, Self::name_or_empty, and Self::owned_name_or_empty already share on the metadata-slot × empty-sentinel axis.

Peer to Self::owned_name_or_empty on the (metadata.name × metadata.namespace) axis of the owned-form projection family — closes the corner the pool-side family previously left open:

  • owned + name + empty sentinel → Self::owned_name_or_empty (AllocationRef.name seed, HashMap<String, _> key seed);
  • owned + namespace + empty sentinel → this method (AllocationRef.namespace seed — the paired half the same AllocationRef::new(name, namespace) constructor consumes);
  • copy + deletion + tombstone probe → Self::is_being_deleted (the presence-probe corner of the same metadata axis, already opened).

A future normalization step (a namespace-canonicalization pass, a case-fold key builder, a per-cluster prefix stripper, or the canonical-namespace default lift that would substitute crate::crd::Process::DEFAULT_NAMESPACE on the missing-slot corner rather than the empty-string sentinel) lands at ONE substrate method here and both downstream consumers pick up the upgrade mechanically — no per-callsite hand-edit at AllocationConvergenceCtx::observe / the composition pin.

The empty-string fallback (rather than crate::crd::Process::DEFAULT_NAMESPACE) is DELIBERATELY pinned: the sole downstream consumer (AllocationConvergenceCtx::observe’s matched-pool seed) feeds the produced value into AllocationRef.namespace, which is then matched byte-identically against spec.pool_ref.namespace at [crate::pool::allocation_decide::resolve_pool]-style comparators. A silent substitution of "default" at this primitive would alias every namespace-absent pool to the "default" bucket at the matcher, hiding the missing-slot corner from an operator who explicitly authored an allocation against a namespace- unset pool. The load-bearing empty-string sentinel keeps the pre-lift .clone().unwrap_or_default() shape verbatim so the downstream matcher’s byte-comparison stays honest.

Theory anchor: THEORY.md §VI.1 (generation over composition — the .metadata.namespace.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-namespace 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::owned_name_or_empty on the paired-slot axis, so a regression that drifted any surface at tests::owned_namespace_or_empty_* rather than as silent operator-facing skew between the paired name / namespace halves of the SAME AllocationRef seed).

Source

pub fn has_name(&self, candidate: &str) -> bool

Copy-form metadata-projection primitive on the metadata.name axis of EphemeralPool in its presence-and-equal corner: returns true iff the K8s object name slot is BOTH Some(_) AND byte-identical to the supplied candidate — the ONE-liner collapse of the paired self.metadata.name.as_deref() == Some(candidate) incantation every pool-side lookup consumer restated by hand pre-lift.

Pre-lift the .metadata.name.as_deref() == Some(<candidate>) chain was hand-authored at TWO production sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-pool-reconciler, both keyed by the EphemeralPool’s own name slot inside a candidate_pools.iter().find(|p| ...) closure that resolves a pool from an AllocationRef.name half:

  • allocation_decide::resolve_pool — the explicit-pool_ref half of the pool-resolution ladder, one of two conjuncts in the (name == X && namespace == Y) byte-comparison against AllocationSpec::pool_ref. Pairs with the sibling namespace comparison (a future run may lift has_namespace as the paired-axis peer once a second namespace-probe site opens).
  • controller_allocation::reconcile_inner — the TTL-inheritance fallback path’s pool-lookup by AllocationDecision::Bind::pool .name, feeding the matched pool’s spec.template.ttl into the just-bound member Process’s lifetime overlay.

Both sites walked the SAME .as_deref() == Some(<x>.as_str()) chain against a &str candidate held by an AllocationRef or a similar owned-name handle, and both wanted the bool form the primitive returns — the transition rule’s discriminant on either the find(|p| p.has_name(&pool_ref.name)) closure (which either matches ONE candidate pool or none) or the TTL-inheritance closure’s short-circuit through .map(...).unwrap_or_else(...). Post-lift each callsite reads p.has_name(&candidate) and the produced bool feeds the same downstream find / map closure unchanged.

Distinct in semantics from the sibling primitive Self::name_or_empty on the SAME metadata.name axis: the _or_empty family folds the missing-slot corner to the load- bearing empty-string sentinel (so None and Some("") both project to ""), whereas this primitive keeps None distinct from Some("") at the == operator — a None slot returns false even when the candidate is the empty string. That discipline is load-bearing at both consumer sites: pre-lift they compared Option<&str> against Some(<candidate>), so a substitution through Self::name_or_empty would silently promote a namespace-absent pool with a "" candidate into a spurious match at the find closure, aliasing every unnamed pool to the same lookup bucket at the resolver. Preserving the None ⇒ false corner keeps the resolver’s byte-comparison honest.

Peer to the sibling substrate primitives already opened on the pool-side (metadata.name × return-form) axis:

  • borrow-form + empty sentinel → Self::name_or_empty (&str projection with a "" fallback for missing / explicitly-empty name slots; router tie-break comparator);
  • owned-form + empty sentinel → Self::owned_name_or_empty (String projection with a "" fallback; AllocationRef.name seed);
  • presence-and-equal probe → this method (bool projection with None-preserving semantics; pool-lookup closure discriminant).

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

Theory anchor: THEORY.md §VI.1 (generation over composition — the .metadata.name.as_deref() == Some(<candidate>) 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-slot corner (None ⇒ false, even against a "" candidate) + the populated-slot equal corner + the populated-slot unequal corner + the byte-identical parity with the pre-lift .as_deref() == Some (<candidate>) chain + the disjoint semantics vs. the _or_empty sibling family, so a regression that drifted any surface at tests::has_name_* here rather than as silent operator-facing skew between the two find closures the primitive owns).

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> Annotated for T
where T: Resource<DynamicType = ()>,

Source§

fn annotation(&self, key: &str) -> Option<&str>

Borrow one key from metadata.annotations. See the trait-level docs for the axis-family context, peer inherent method, and future-normalization anchor.
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> DeletionTombstoned for T
where T: Resource<DynamicType = ()>,

Source§

fn is_being_deleted(&self) -> bool

True iff the K8s API server has stamped metadata.deletionTimestamp on this resource — a DELETE is in flight and finalizers are draining. See the trait-level docs for the axis-family context, peer inherent methods, and future-normalization anchor.
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> NamespacedApiCoordinates for T
where T: Resource<DynamicType = ()>,

Source§

fn owned_coordinates_required(&self) -> Result<(String, String)>

Extract the K8s API path coordinates as owned Strings, erroring with a Self::kind-prefixed message when either slot is absent. See the trait-level docs for the axis-family context, peer primitives, and future-normalization anchor.
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, !>

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