pub struct LaunchDecision {
pub label: String,
pub value: String,
pub source: Option<String>,
}Expand description
One resolved launch decision, paired with the reason it was chosen.
Self::source is the whole point of the type — a value without its
provenance tells a user what happened but never why, which is precisely
the gap this record closes.
Fields§
§label: StringShort stable key naming the decision: ctx, backend, kv,
cache, mtp, flags, dialect.
Stable because the GUI and the CLI dashboard both key styling off it; treat it as part of the wire contract rather than a display string.
value: StringDisplay-ready value, e.g. 32768 or q8_0 -> 2.1 GB, f16 would be 4.2 GB.
source: Option<String>Where the value came from, rendered in parentheses by every consumer.
None only for decisions whose value already states its own origin —
never as a shortcut for “didn’t bother”, since an unexplained value is
the exact failure mode this type exists to prevent.
Implementations§
Source§impl LaunchDecision
impl LaunchDecision
Sourcepub fn new(
label: impl Into<String>,
value: impl Into<String>,
source: impl Into<String>,
) -> Self
pub fn new( label: impl Into<String>, value: impl Into<String>, source: impl Into<String>, ) -> Self
A decision whose provenance is worth stating.
Sourcepub fn bare(label: impl Into<String>, value: impl Into<String>) -> Self
pub fn bare(label: impl Into<String>, value: impl Into<String>) -> Self
A decision that is self-explanatory — see Self::source for when
that is legitimate.
Sourcepub fn render_value(&self) -> String
pub fn render_value(&self) -> String
Render as value (source), or just value when unsourced.
Trait Implementations§
Source§impl Clone for LaunchDecision
impl Clone for LaunchDecision
Source§fn clone(&self) -> LaunchDecision
fn clone(&self) -> LaunchDecision
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 LaunchDecision
impl Debug for LaunchDecision
Source§impl<'de> Deserialize<'de> for LaunchDecision
impl<'de> Deserialize<'de> for LaunchDecision
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>,
Source§impl PartialEq for LaunchDecision
impl PartialEq for LaunchDecision
Source§fn eq(&self, other: &LaunchDecision) -> bool
fn eq(&self, other: &LaunchDecision) -> bool
self and other values to be equal, and is used by ==.