pub struct CliRoute {
pub path: &'static [&'static str],
pub verb: &'static str,
pub args: &'static [CliArg],
pub examples: &'static [CliExample],
}Expand description
Where a command sits in the command line, and how it presents itself.
Opt-in by construction: a command joins the command line only by declaring one, so internal plumbing cannot reach an agent- or human-facing surface by being written.
path is a slice rather than a single noun because flat command names hide
a hierarchy: list_session_participants is sessions participants list.
Deriving that by string surgery is wrong for exactly the irregular names
that matter, so the shape is declared.
Fields§
§path: &'static [&'static str]Noun path from the root, e.g. ["agents"] or ["agents", "versions"].
verb: &'static strLeaf verb, e.g. "list".
args: &'static [CliArg]Presentation for the parameters that need more than the default.
examples: &'static [CliExample]Worked examples, rendered under the command’s help.
Implementations§
Trait Implementations§
impl Copy for CliRoute
impl Eq for CliRoute
impl StructuralPartialEq for CliRoute
Auto Trait Implementations§
impl Freeze for CliRoute
impl RefUnwindSafe for CliRoute
impl Send for CliRoute
impl Sync for CliRoute
impl Unpin for CliRoute
impl UnsafeUnpin for CliRoute
impl UnwindSafe for CliRoute
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