pub enum EmbeddedAgent {
Direct {
name: &'static str,
md: &'static str,
},
Composed {
name: &'static str,
},
}Expand description
One embedded default agent: either self-contained (tcode’s own 3
defaults, no extends: chain) or a roster agent whose extends: chain is
resolved at load time against EMBEDDED_TM_AGENT_SOURCES (Slice E3,
#2958).
Why: agents::mod’s embedded-fallback needs a single ordered table
(DEFAULT_AGENTS) covering both projection strategies tcode’s embedded
agents need: tcode’s own 3 defaults are flat .md strings with no
inheritance (projected via agents::md_loader::project_embedded_md); the
28 tm roster agents inherit from BASE-* templates and must be composed
in-memory (agents::md_loader::project_embedded_md_with_extends) before
projection. One enum keeps both variants in the same ordered slice rather
than two parallel tables that could silently drift out of sync in count
or ordering.
What: EmbeddedAgent::Direct carries the dispatch name and the raw
.md source (frontmatter fence + prose body) verbatim. EmbeddedAgent::Composed
carries only the dispatch name — its content is resolved from
EMBEDDED_TM_AGENT_SOURCES at load time, since the whole point of the
in-memory composer is that no second copy of the raw bytes is needed here.
EmbeddedAgent::name reads the name back out of either variant.
Test: assets::tests::default_agents_parse_and_names_match.
Variants§
Direct
A self-contained agent: raw .md source, no extends: chain.
Fields
Composed
A roster agent resolved via agents::md_loader::project_embedded_md_with_extends
against EMBEDDED_TM_AGENT_SOURCES at load time.
Implementations§
Source§impl EmbeddedAgent
impl EmbeddedAgent
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The dispatch key, regardless of variant.
Why: callers (the embedded-fallback loader, tests) usually only need
the name and would otherwise have to match on the variant just to
read one shared field.
What: returns name from either Direct or Composed.
Test: assets::tests::default_agents_parse_and_names_match.
Trait Implementations§
Source§impl Clone for EmbeddedAgent
impl Clone for EmbeddedAgent
Source§fn clone(&self) -> EmbeddedAgent
fn clone(&self) -> EmbeddedAgent
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 EmbeddedAgent
Auto Trait Implementations§
impl Freeze for EmbeddedAgent
impl RefUnwindSafe for EmbeddedAgent
impl Send for EmbeddedAgent
impl Sync for EmbeddedAgent
impl Unpin for EmbeddedAgent
impl UnsafeUnpin for EmbeddedAgent
impl UnwindSafe for EmbeddedAgent
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<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