Skip to main content

Process

Struct Process 

Source
pub struct Process {
    pub metadata: ObjectMeta,
    pub spec: ProcessSpec,
    pub status: Option<ProcessStatus>,
}
Expand description

Auto-generated derived type for ProcessSpec via CustomResource

Fields§

§metadata: ObjectMeta§spec: ProcessSpec§status: Option<ProcessStatus>

Implementations§

Source§

impl Process

Source

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

Spec based constructor for derived custom resource

Source§

impl Process

Source

pub const DEFAULT_NAMESPACE: &'static str = "default"

The K8s canonical default namespace — the fallback every consumer of a Process whose metadata.namespace is None substitutes. Matches the string K8s itself substitutes on namespaced resource writes with no explicit namespace.

Source

pub const UNNAMED_PLACEHOLDER: &'static str = "unnamed"

Workspace-wide fallback for a Process’s metadata.name when it is None — the sentinel every annotation writer, claim arbiter, and owner-metadata seed substitutes so downstream grepping / label-selecting sees a stable spelling rather than a per-callsite ad-hoc placeholder ("", "<unnamed>", or the empty unwrap_or_default() fallback). A Process authored through the reconciler’s fork path always has a name; this constant covers the surface where an untyped Process value (test fixture, dynamic API response, adopted resource pre- name-resolution) surfaces without one.

Source

pub fn namespace_or_default(&self) -> &str

Namespace slice with the Self::DEFAULT_NAMESPACE fallback applied — the ONE-line collapse of the metadata.namespace .as_deref().unwrap_or("default") incantation every consumer spelled by hand pre-lift.

Peer to Self::name_or_placeholder on the (metadata slot × fallback shape) axis; both compose through Self::coordinates_or_defaults when a consumer needs the pair together (annotation writers, claim-arbiter row builders, render owner-metadata seed).

Source

pub fn name_or_placeholder(&self) -> &str

Name slice with the Self::UNNAMED_PLACEHOLDER fallback applied — the ONE-line collapse of the metadata.name.as_deref ().unwrap_or("unnamed") incantation every consumer spelled by hand pre-lift.

Peer to Self::namespace_or_default on the (metadata slot × fallback shape) axis; both compose through Self::coordinates_or_defaults when a consumer needs the pair together.

Source

pub fn coordinates_or_defaults(&self) -> (&str, &str)

(namespace, name) coordinates with the workspace-wide default fallbacks applied — the ONE-line collapse of the paired metadata.namespace.as_deref().unwrap_or("default") + metadata.name.as_deref().unwrap_or("unnamed") extraction every downstream composer restated by hand pre-lift.

Return-tuple order matches the axis order of the substrate’s paired-composer primitive tatara_reconciler::ssapply::qualified_process_ref(ns, name): the (namespace, name) pair this method returns feeds that primitive positionally without an axis-swap step.

Source

pub fn owned_coordinates_or_err(&self) -> Result<(String, String)>

(namespace, name) coordinates as owned Strings, with the namespace half fallback-defaulted to Self::DEFAULT_NAMESPACE but the name half REQUIRED — an anyhow::Error is returned when metadata.name is absent, because “unnamed” is a display placeholder, not a valid K8s API path segment. Fed straight into kube-rs API calls (Api::patch, Api::delete, Api::get) that take owned String arguments; the Self::DEFAULT_NAMESPACE fallback matches what K8s itself substitutes on namespaced resource writes with no explicit namespace, so the surface is safe against a Process whose metadata.namespace slot is absent (test fixture, dynamic API response pre-defaulting) but refuses to guess a name.

Peer to Self::coordinates_or_defaults on the (return-form × name gate) axis pair:

  • borrow + name-defaulted → coordinates_or_defaults (display, annotation writers, ownership-tag composers — every consumer whose downstream drops "unnamed" in place of a missing name without an operator-visible failure);
  • owned + name-required → this method (kube-rs API calls — every consumer whose downstream must NOT silently substitute a placeholder for the API call target, because the caller is about to patch/delete/get at metadata.name).

The error wording is pinned by [tests::owned_coordinates_or_err_error_message_matches_pre_lift_reconciler_wording] to match the exact spelling every pre-lift tatara-reconciler helper produced ("Process has no metadata.name") so log-line / test greps that anchored on that wording keep matching post- lift, and no operator-visible message drift lands as a side effect of the substrate move.

Source

pub fn coordinates_or_none(&self) -> Option<(&str, &str)>

(namespace, name) coordinates in the BORROW + NAME-REQUIRED corner of the primitive family — namespace half falls back to Self::DEFAULT_NAMESPACE, but the name half is REQUIRED (None on a Process whose metadata.name is absent, so the caller stops with an else { continue; } / else { return …; } guard rather than proceeding with the empty-string sentinel every pre-lift consumer had to spell inline).

Peer to Self::coordinates_or_defaults + Self::owned_coordinates_or_err on the (return-form × name-gate) axis pair — closes the corner the family previously left open:

  • borrow + name-defaulted → Self::coordinates_or_defaults (annotation writers, render owner-metadata seed — consumers whose downstream tolerates the "unnamed" display placeholder without operator-visible failure);
  • borrow + name-required → this method (claim-arbiter probes, child-Process delete-fan-out — consumers that need a real API-path leaf and cleanly SKIP the row when the name is absent rather than issuing a K8s call with an empty-string name argument);
  • owned + name-required → Self::owned_coordinates_or_err (kube-rs API-path calls — consumers whose downstream requires owned String arguments and rejects the missing-name corner with a load-bearing error message).

The primitive family’s None-on-missing-name semantics intentionally differs from Self::owned_coordinates_or_err’s error-on-missing-name semantics: the caller sites for this form (child-Process fan-out, claim-arbiter row probes) are non-fatal SKIPS rather than reportable failures — an Option::None at the primitive lets the caller thread that “skip” through a let-else without stringifying / logging an anyhow chain per missing-name occurrence.

The namespace fallback matches Self::coordinates_or_defaults (via Self::namespace_or_default), so a consumer that switches between the two borrow-form primitives based on its name-gate need never sees a different namespace-fallback string as a side effect.

Source

pub fn observed_flux_resources(&self) -> &[FluxResourceRef]

Borrowed slice of the FluxCD resources this Process’s status currently persists at status.flux_resources, with the missing-status corner collapsed to an empty slice — the ONE- line collapse of the paired self.status.as_ref().map(|s| s.flux_resources.clone()).unwrap_or_default() incantation every VERIFY-phase / ATTEST-heartbeat consumer restated by hand pre-lift.

Pre-lift the 5-line .status.as_ref().map(|s| s.flux_resources .clone()).unwrap_or_default() chain was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-reconciler::phase_machine:

  • handle_running — the VERIFY-phase per-ref readiness probe seed that walks every ref through crate::status::FluxResourceRef::fetch_coords via ssapply::fetch_flux_ref and rebuilds an updated Vec<FluxResourceRef> with ready + message + last_check observed at reconcile time.
  • handle_attested — the ATTEST-heartbeat drift detector that short-circuits on the first non-Ready ref via ssapply::fetch_flux_ref + ssapply::ready_condition.

Both sites walked the SAME 5-line chain — clone the vector eagerly for the length of the reconcile pass, then iterate it by reference — even though neither site ever mutates the vector nor keeps it alive past the enclosing async fn. Post-lift both callers borrow the slice directly from self.status; the two pre-lift .clone() calls disappear because the slice lives for the borrow of &self, and both call sites’ subsequent downstream calls (ssapply::fetch_flux_ref / the patch::patch_process_status write) do not touch the borrowed p: &Process, so the borrow lifetime holds.

Return-form axis: &[FluxResourceRef] mirrors the existing borrow-first discipline every pre-lift consumer already iterated by reference (for r in &refs), and the shape of crate::status::FluxResourceRef::fetch_coords’s per-ref borrow projection extends mechanically to the slice-level projection here. The missing-status corner collapses to the empty slice &[] so .is_empty() / .len() / iteration all behave identically on a Process whose status is None and on one whose status carries an empty flux_resources slot — matching what the pre-lift .unwrap_or_default() produced (an empty Vec).

A future normalization step (a per-ref canonicalization pass that skips duplicated refs, an owner-filter that returns only refs stamped with the CURRENT metadata.generation, a staleness gate that drops refs whose last_check predates a reconcile deadline) lands at ONE substrate method here and both downstream consumers pick up the upgrade mechanically — no per-callsite hand-edit at handle_running / handle_attested.

Sibling to the Self::coordinates_or_none borrow-first primitive on the metadata axis; this method opens the analogous borrow-first primitive on the status-projection axis. Future status projections (observed_attestation on the attestation-chain axis, observed_pid on the PID axis, observed_children on the child-fan-out axis) land as peer methods on this same axis.

Theory anchor: THEORY.md §VI.1 (generation over composition — the 5-line status-projection 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-status corner + the slice-lifetime borrow discipline

  • the byte-identical parity with the pre-lift 5-line chain, so a regression that drifted any of the three surfaces at tests::observed_flux_resources_* rather than as silent operator-facing skew between the VERIFY-phase and ATTEST- heartbeat consumers).
Source

pub fn observed_pid(&self) -> Option<&str>

The borrow-form status-projection primitive on the PID axis: returns the hierarchical PID path (e.g. "seph.1.7") the reconciler currently persists at status.pid, with BOTH the missing-status corner AND the empty-slot corner collapsed to None — the ONE-liner collapse of the paired self.status.as_ref().and_then(|s| s.pid.clone()) incantation every consumer restated by hand pre-lift.

Pre-lift the 3-line .status.as_ref().and_then(|s| s.pid .clone()) chain was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-reconciler::phase_machine:

  • handle_forking — the ALLOCATE-PID gate that short- circuits the PID allocator when the reconciler already assigned a PID on a prior reconcile pass (pre-lift the chain composed with .is_some() and threw the clone away without ever reading the string).
  • handle_exiting — the SIGTERM cascade that enumerates child Processes and terminates them by matching each child’s spec.identity.parent against the PID this Process currently owns (pre-lift the chain bound an owned Option<String> and threaded pid.as_str() into the downstream .as_deref() == Some(...) comparator).

Both sites walked the SAME 3-line chain — clone the String eagerly, then either drop it (the handle_forking gate) or re-borrow it through .as_str() (the handle_exiting comparator) — even though neither site ever mutates the PID nor keeps it alive past the enclosing async fn. Post-lift both callers borrow the PID directly from self.status; the pre-lift .clone() at both sites disappears because the &str lives for the borrow of &self, and both call sites’ subsequent downstream calls (the K8s API list/patch, the child-Process comparator) do not touch the borrowed p: &Process, so the borrow lifetime holds.

Return-form axis: Option<&str> mirrors the existing borrow-first discipline every pre-lift consumer already re-borrowed through .as_str() before use, and the shape of Self::coordinates_or_none’s Option<(&str, &str)> projection extends mechanically to the single-slot projection here. The missing-status corner AND the populated-status-with-pid=None corner BOTH collapse to None so .is_some() / if let Some(_) / .map(...) behave identically on a Process whose status is None and on one whose status carries an unpopulated pid slot — matching what the pre-lift .and_then(...) chain produced.

A future normalization step (a per-slot canonicalization pass that rejects malformed hierarchical PIDs, a generation-filter that returns None for a PID stamped with a stale metadata.generation, a staleness gate that drops a PID whose observing phase_since predates a reconcile deadline) lands at ONE substrate method here and both downstream consumers pick up the upgrade mechanically — no per-callsite hand-edit at handle_forking / handle_exiting.

Sibling to the peer Self::observed_flux_resources borrow-first primitive on the flux-resources axis; both methods compose the same missing-status fallback + borrow-form return-shape skeleton on distinct ProcessStatus slots. Future status projections (observed_parent on the parent-pointer axis, observed_message on the human-readable-status axis, observed_attestation on the attestation-chain axis) land as peer methods on this same axis.

Theory anchor: THEORY.md §VI.1 (generation over composition — the 3-line status-projection 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-status corner + the empty-slot corner + the borrow-form &str lifetime + the byte-identical parity with the pre-lift 3-line chain, so a regression that drifted any surface at tests::observed_pid_* rather than as silent operator- facing skew between the ALLOCATE-PID gate and the SIGTERM cascade on the SAME Process).

Source

pub fn observed_attestation(&self) -> Option<&ProcessAttestation>

The borrow-form status-projection primitive on the attestation-chain axis: returns the last ProcessAttestation the reconciler persisted at status.attestation, with the missing-status corner AND the empty-slot corner BOTH collapsed to None — the ONE-liner collapse of the paired self.status.as_ref().and_then(|s| s.attestation.as_ref()) incantation every consumer restated by hand pre-lift.

Pre-lift the 3-line .status.as_ref().and_then(|s| s .attestation.as_ref()) chain was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-reconciler:

  • phase_machine::advance_to_attested — the ATTEST composer that chains prior.next(pillars) when a prior attestation is persisted and seeds with ProcessAttestation::initial otherwise.
  • render::render_export_jobs — the ephemeral-export Job builder that pulls the prior composed_root off the last persisted attestation and threads it into every rendered Job’s previousRoot env var, so the export receipt chains into the Process’s BLAKE3 attestation tree at the correct generation boundary.

Both sites walked the SAME 3-line chain — the borrow-form Option<&ProcessAttestation> shape both consumers wanted already — even though neither site ever mutated the attestation nor kept it alive past the enclosing async fn. Post-lift both callers borrow the attestation directly from self.status; the pre-lift 3-line chain shrinks to a single method call at both sites, and both consumers’ subsequent downstream calls (ProcessAttestation::next for the ATTEST composer, .composed_root.clone() for the export Job builder) do not touch the borrowed p: &Process, so the borrow lifetime holds.

Return-form axis: Option<&ProcessAttestation> mirrors the existing borrow-first discipline every pre-lift consumer already re-borrowed through .as_ref(), and the shape of the peer Self::observed_pid projection extends mechanically to the whole-attestation-record projection here. The missing- status corner AND the populated-status-with-attestation =None corner BOTH collapse to None so .is_some() / if let Some(_) / .map(...) behave identically on a Process whose status is None and on one whose status carries an unpopulated attestation slot — matching what the pre-lift .and_then(...) chain produced.

A future normalization step (a per-slot canonicalization pass that rejects a persisted attestation whose composed_root fails verify, a generation-filter that returns None for an attestation stamped with a stale metadata.generation, a staleness gate that drops an attestation whose attested_at predates a reconcile deadline) lands at ONE substrate method here and both downstream consumers pick up the upgrade mechanically — no per-callsite hand-edit at advance_to_attested / render_export_jobs.

Sibling to the peer Self::observed_pid + Self::observed_flux_resources borrow-first primitives on the PID + flux-resources axes; all three methods compose the same missing-status fallback + borrow-form return-shape skeleton on distinct ProcessStatus slots. Future status projections (observed_parent on the parent-pointer axis, observed_message on the human-readable-status axis) land as peer methods on this same axis.

Theory anchor: THEORY.md §VI.1 (generation over composition — the 3-line status-projection 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-status corner + the empty-slot corner + the borrow-form &ProcessAttestation lifetime + the byte- identical parity with the pre-lift 3-line chain, so a regression that drifted any surface at tests::observed_attestation_* rather than as silent operator-facing skew between the ATTEST composer and the ephemeral-export receipt chain on the SAME Process).

Source

pub fn observed_phase(&self) -> Option<ProcessPhase>

The copy-form status-projection primitive on the phase axis: returns the ProcessPhase the reconciler currently persists at status.phase, wrapped in an Option so the missing- status corner collapses to None — the ONE-liner collapse of the paired self.status.as_ref().map(|s| s.phase) incantation every consumer restated by hand pre-lift.

Peer to the borrow-form projections Self::observed_pid (PID axis, Option<&str>), Self::observed_flux_resources (flux-resources axis, &[FluxResourceRef]), and Self::observed_attestation (attestation-chain axis, Option<&ProcessAttestation>); this method opens the copy-form peer for ProcessPhase — a Copy scalar with a Default impl (Pending), so the return is Option<ProcessPhase> rather than Option<&ProcessPhase> (borrow would give the caller nothing over the copy for a 1-byte enum) and neither the missing-status corner nor a “empty slot” corner is meaningful — the underlying slot is a bare ProcessPhase, not Option<ProcessPhase>, so the primitive returns None iff status: None.

Pre-lift the 3-line .status.as_ref().map(|s| s.phase) chain was hand-authored at FIVE sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold in tatara-reconciler:

  • controller::reconcile — the top-level dispatcher’s current_phase seed that feeds the deletion-preempt + signal-ingestion gates + the per-phase handler dispatch. Pre-lift .unwrap_or(ProcessPhase::Pending).
  • boundary::evaluate_process_phase — the boundary evaluator’s ProcessPhase condition (a peer-Process phase-reached postcondition). Pre-lift .unwrap_or(ProcessPhase::Pending).
  • boundary::check_depends_on — the depends_on pre-condition audit that stashes the observed phase into the UnmetDependency::actual: Option<ProcessPhase> slot (keeps the Option form). Pre-lift the raw .map(|s| s.phase) shape.
  • phase_machine::p_current_phase_str — the released-from annotation composer that emits "Attested" for every non-Failed phase (SIGSTOP/SIGCONT release gate). Pre-lift .unwrap_or(ProcessPhase::Attested) — the ONE site whose default is not Pending; the primitive returns the raw Option so the caller’s .unwrap_or default choice stays local rather than baked in.
  • table_controller::stable_name_group_key — the routing- groupby seed that pairs the phase with the PID + creation timestamp when partitioning Processes claiming the same stable name. Pre-lift .unwrap_or(ProcessPhase::Pending).

All FIVE sites walked the SAME 3-line .status.as_ref() .map(|s| s.phase) chain — three closed with unwrap_or (ProcessPhase::Pending) (the Default), one closed with unwrap_or(ProcessPhase::Attested), one kept the raw Option<ProcessPhase> — so the ONE substrate accessor returns the raw Option<ProcessPhase> and each consumer keeps its .unwrap_or(...) default choice at its own site.

A future normalization step (a generation-filter that returns None for a phase stamped with a stale metadata.generation, a staleness gate that drops a phase whose observing phase_since predates a reconcile deadline, a canonicalization pass that maps a phase that no longer belongs to the CRD’s closed set to None) lands at ONE substrate method here and all five consumers pick up the upgrade mechanically — no per-callsite hand-edit at reconcile / evaluate_process_phase / check_depends_on / p_current_phase_str / stable_name_group_key.

Future status projections (observed_parent on the parent-pointer axis, observed_message on the human- readable-status axis, observed_children on the child fan-out axis, observed_exit_code on the terminal-exit axis) land as peer methods on this same axis.

Theory anchor: THEORY.md §VI.1 (generation over composition — the 3-line status-projection chain recurred at FIVE 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-status corner + the per-variant enum round-trip + the byte-identical parity with the pre-lift 3-line chain, so a regression that drifted any surface at tests::observed_phase_* rather than as silent operator-facing skew between the controller’s dispatch seed and the boundary evaluator’s depends-on audit on the SAME Process within one reconcile pass).

Trait Implementations§

Source§

impl Clone for Process

Source§

fn clone(&self) -> Process

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 Process

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 Process

Source§

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

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

impl<'de> Deserialize<'de> for Process

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 Process

Source§

type Spec = ProcessSpec

The type of the spec of this resource
Source§

fn spec(&self) -> &ProcessSpec

Returns a reference to the spec of the object
Source§

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

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

impl HasStatus for Process

Source§

type Status = ProcessStatus

The type of the status object
Source§

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

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

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

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

impl JsonSchema for Process

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 Process

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 Process

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