pub enum ConfigSource {
TrustyCode,
ClaudeCompat,
OpenMpmLegacy,
Default,
}Expand description
Which configuration root a resolved path came from.
Why: “the winning source” is a diagnostic every CLI and log line needs, and
deriving it back out of a PathBuf by string-matching would be a second,
drifting implementation of SEARCH_ROOTS.
What: one variant per search root, plus ConfigSource::Default for the
case where nothing exists yet and the resolver names the native path anyway.
Test: paths::tests::precedence_prefers_trusty_code_over_claude,
paths::tests::default_source_when_nothing_exists.
Variants§
TrustyCode
<project>/.trusty-code/… — Trusty Code’s own directory.
ClaudeCompat
<project>/.claude/… — Claude Code compatibility input.
OpenMpmLegacy
<project>/.open-mpm/… — pre-Claude-Code legacy input.
Default
Nothing exists yet; the path names the native location regardless.
Implementations§
Source§impl ConfigSource
impl ConfigSource
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
A stable lowercase token for logs, JSON diagnostics, and CLI output.
Why: the CLI and the log field must agree, and a Debug rendering is not
a wire contract.
What: "trusty-code", "claude", "open-mpm", "default".
Test: paths::tests::source_tokens_are_stable.
Sourcepub fn is_native(self) -> bool
pub fn is_native(self) -> bool
Whether this source is Trusty Code’s own directory.
Why: a caller deciding whether to suggest tcode config import needs the
question answered once, here.
What: true for ConfigSource::TrustyCode and ConfigSource::Default
— both name a path beneath .trusty-code/.
Test: paths::tests::source_tokens_are_stable.
Trait Implementations§
Source§impl Clone for ConfigSource
impl Clone for ConfigSource
impl Copy for ConfigSource
Source§impl Debug for ConfigSource
impl Debug for ConfigSource
impl Eq for ConfigSource
Source§impl PartialEq for ConfigSource
impl PartialEq for ConfigSource
impl StructuralPartialEq for ConfigSource
Auto Trait Implementations§
impl Freeze for ConfigSource
impl RefUnwindSafe for ConfigSource
impl Send for ConfigSource
impl Sync for ConfigSource
impl Unpin for ConfigSource
impl UnsafeUnpin for ConfigSource
impl UnwindSafe for ConfigSource
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,
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