pub enum HarnessMode {
DailyDriver,
Parity,
}Expand description
The two harness modes §5.9 resolves between.
Why: see module docs. A closed, two-variant enum (not a raw String)
so every downstream match is exhaustive and a typo can never silently
select an unintended mode.
What: DailyDriver (default; where P1B’s token-efficiency layers will
apply) and Parity (full schemas, parity-spec benchmark mode). Wire
representation is "daily-driver" / "parity" (kebab-case), matching
§5.9’s example JSON verbatim.
Test: mode::tests::wire_representation_is_kebab_case.
Variants§
Implementations§
Source§impl HarnessMode
impl HarnessMode
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
The stable wire string for this mode (matches the serde
rename_all = "kebab-case" representation).
Why: callers building a plain JSON response field (task.run’s
immediate {"mode": ...}, the CLI’s human-readable summary line)
want this without round-tripping through serde_json.
Test: mode::tests::as_str_matches_serde_rename.
Sourcepub fn parse_lenient(s: &str) -> Option<Self>
pub fn parse_lenient(s: &str) -> Option<Self>
Parse a mode string leniently: case-insensitive, _/-
interchangeable, surrounding whitespace ignored.
Why: every precedence tier’s raw value (an env var, a JSON string
field, a CLI flag) is human-typed and should not require
byte-perfect casing to work.
What: None for anything that isn’t recognisably "daily-driver"
or "parity" — callers treat None as “this source does not
contribute a value”, falling through to the next-lower-precedence
tier (see resolve_mode’s docs for why this, rather than a hard
error, was chosen).
Test: mode::tests::parse_lenient_accepts_case_and_separator_variants,
mode::tests::parse_lenient_rejects_unknown_values.
Trait Implementations§
Source§impl Clone for HarnessMode
impl Clone for HarnessMode
Source§fn clone(&self) -> HarnessMode
fn clone(&self) -> HarnessMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HarnessMode
Source§impl Debug for HarnessMode
impl Debug for HarnessMode
Source§impl<'de> Deserialize<'de> for HarnessMode
impl<'de> Deserialize<'de> for HarnessMode
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 HarnessMode
Source§impl PartialEq for HarnessMode
impl PartialEq for HarnessMode
Source§impl Serialize for HarnessMode
impl Serialize for HarnessMode
impl StructuralPartialEq for HarnessMode
Auto Trait Implementations§
impl Freeze for HarnessMode
impl RefUnwindSafe for HarnessMode
impl Send for HarnessMode
impl Sync for HarnessMode
impl Unpin for HarnessMode
impl UnsafeUnpin for HarnessMode
impl UnwindSafe for HarnessMode
Blanket Implementations§
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
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§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> 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 more