pub struct AllocationRef {
pub name: String,
pub namespace: String,
}Expand description
Light reference to an EphemeralAllocation.
Fields§
§name: String§namespace: StringImplementations§
Source§impl AllocationRef
impl AllocationRef
Sourcepub fn new(name: impl Into<String>, namespace: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, namespace: impl Into<String>) -> Self
Substrate constructor for AllocationRef: composes the
(name, namespace) pair through ONE impl Into<String>-gated
entry point — the ONE-liner collapse of the paired
AllocationRef { name: n.into(), namespace: ns.into() }
struct-literal incantation every downstream consumer restated
by hand pre-lift.
Pre-lift the AllocationRef { name, namespace } struct-literal
was hand-authored at FOUR production sites past the ★★ PRIME-
DIRECTIVE ≥ 2 duplication threshold across the workspace, all
composing an owned (name: String, namespace: String) pair
under one of two roles:
tatara-pool-reconciler::controller_allocation::reconcile_innerBind path — theassignedProcessstatus slot’s ref, pairing the just-bound member Process name with the allocation’s containing namespace.tatara-pool-reconciler::controller_allocation::reconcile_innerRelease path — the sameassignedProcessslot shape, stamped at the release-side status patch alongside the (unchanged)boundPoolref.tatara-pool-reconciler::allocation_decide::AllocationConvergenceCtx::observepool-matched handle — thematched_poolslot’s ref, pairingEphemeralPool::owned_name_or_emptywith the pool’s containing namespace.tatara-github-watcher::allocation_factory::allocation_from_pr— thepool_refslot on theAllocationSpecemitted from a PullRequestEvent, pairing the operator-configured pool name with the watcher’s target namespace.
All FOUR sites walked the SAME two-field struct-literal shape
— an owned name half, an owned namespace half — differing only
in provenance. Post-lift each callsite reads
AllocationRef::new(name, ns) and the produced value feeds the
same downstream slot (assignedProcess / bound_pool /
matched_pool / spec.pool_ref) unchanged. The impl Into<String>
signature accepts every provenance the pre-lift sites carried —
owned String (the reconciler’s owned-form projections), &str
(the factory’s n.to_string() / namespace.to_string()
borrow-to-owned promotions), Cow<str>, and every other
Into<String> implementor — so no callsite has to change its
upstream provenance to route through the primitive.
Return-form axis: owned AllocationRef — the wire-format
shape crate::pool::AllocationRef’s serde rename_all = "camelCase" produces on both spec (poolRef) and status
(boundPool / assignedProcess) slots. The primitive owns
the axis-order (name, namespace) — the same order the four
consumers spelled — so a slot swap surfaces at the
allocation_ref_new_positional_axis_order pin below rather
than as silent <namespace>/<name> inversion downstream.
Peer to the sibling substrate primitives already opened on the
pool-side (name, namespace) axis pair:
EphemeralPool::name_or_empty (borrow-form name),
EphemeralPool::owned_name_or_empty (owned-form name); this
constructor is the composer that folds the owned-form projections
into the wire-format ref shape.
A future refactor of AllocationRef’s field set (a
resource_kind: String field for cross-CRD refs, an
api_version: String field for FQN references, a
canonicalization pass over the namespace half, a non-empty-name
gate) lands at ONE substrate constructor site here and every
downstream consumer inherits the upgrade mechanically — no per-
callsite hand-edit at the FOUR reconciler + factory sites.
Theory anchor: THEORY.md §VI.1 (generation over composition —
the AllocationRef { name, namespace } struct-literal shape
recurred at four 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 positional axis-order + the
Into<String> provenance closure + byte-identical parity with
the pre-lift struct-literal + PartialEq coherence with the
hand-authored form, so a regression that reshaped any surface
at tests::allocation_ref_new_* rather than as silent
operator-facing skew between the assignedProcess / bound_pool
/ matched_pool / spec.pool_ref slots on the SAME allocation).
Trait Implementations§
Source§impl Clone for AllocationRef
impl Clone for AllocationRef
Source§fn clone(&self) -> AllocationRef
fn clone(&self) -> AllocationRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AllocationRef
impl Debug for AllocationRef
Source§impl<'de> Deserialize<'de> for AllocationRef
impl<'de> Deserialize<'de> for AllocationRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AllocationRef
Source§impl JsonSchema for AllocationRef
impl JsonSchema for AllocationRef
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for AllocationRef
impl PartialEq for AllocationRef
Source§impl Serialize for AllocationRef
impl Serialize for AllocationRef
impl StructuralPartialEq for AllocationRef
Auto Trait Implementations§
impl Freeze for AllocationRef
impl RefUnwindSafe for AllocationRef
impl Send for AllocationRef
impl Sync for AllocationRef
impl Unpin for AllocationRef
impl UnsafeUnpin for AllocationRef
impl UnwindSafe for AllocationRef
Blanket Implementations§
impl<T> AppData for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
impl<T> AppDataResponse for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreimpl<T> OptionalSend for T
impl<T> OptionalSync for T
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
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 bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
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>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
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 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.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
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);