pub struct Composition { /* private fields */ }Expand description
Product-owned commands merged with generated capability routes. Completion receives the merged tree. Fallback receives the original arguments for product commands and unknown root commands. Parse errors on declared commands never reach fallback, with or without a catalogue.
Implementations§
Source§impl Composition
impl Composition
pub const fn new( tree: fn(&ProductContext) -> Result<Spec, String>, completion: fn(&Spec, &[String]) -> Vec<String>, fallback: fn(&ProductContext, &[String]) -> ExitCode, ) -> Self
Sourcepub fn with_specialized_tools(self, names: &'static [&'static str]) -> Self
pub fn with_specialized_tools(self, names: &'static [&'static str]) -> Self
Exclude exact tool identities from CLI generation, never from MCP.
Sourcepub fn run(
&self,
context: &ProductContext,
boards: &[Board],
environment: &ToolEnvironment,
args: &[String],
) -> ExitCode
pub fn run( &self, context: &ProductContext, boards: &[Board], environment: &ToolEnvironment, args: &[String], ) -> ExitCode
Headless product callback using the same served catalogue as MCP. Without one, the product’s own tree still parses, with no generated commands, after a notice on standard error.
Auto Trait Implementations§
impl Forget for Composition
impl Freeze for Composition
impl Move for Composition
impl RefUnwindSafe for Composition
impl Send for Composition
impl Sync for Composition
impl Unpin for Composition
impl UnsafeUnpin for Composition
impl UnwindSafe for Composition
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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