pub struct CommandDef<C: Category, T: Tag, S: Scope> {
pub name: &'static str,
pub summary: &'static str,
pub category: C,
pub tags: &'static [T],
pub scope: S,
pub examples: &'static [Example],
pub see_also: &'static [&'static str],
pub long_description: &'static str,
pub api: &'static [ApiEndpoint],
pub confirmation: Option<Confirmation>,
}Fields§
§name: &'static str§summary: &'static str§category: C§scope: S§examples: &'static [Example]§see_also: &'static [&'static str]§long_description: &'static strMulti-paragraph explanation shown by the ? detail view.
Lines are separated by \n. Empty string means no detail available.
api: &'static [ApiEndpoint]HTTP API equivalents. Empty slice means CLI-only.
confirmation: Option<Confirmation>Optional pre-invocation confirmation gate (CLI-only).
When set, the CLI dispatch layer should call
Confirmation::prompt_stdio before running the command handler.
The HTTP API ignores this field entirely.
Implementations§
Source§impl<C: Category, T: Tag, S: Scope> CommandDef<C, T, S>
impl<C: Category, T: Tag, S: Scope> CommandDef<C, T, S>
Sourcepub fn requires_confirmation(&self) -> bool
pub fn requires_confirmation(&self) -> bool
Returns true if this command requires interactive confirmation
before execution.
Trait Implementations§
Source§impl<C: Clone + Category, T: Clone + Tag, S: Clone + Scope> Clone for CommandDef<C, T, S>
impl<C: Clone + Category, T: Clone + Tag, S: Clone + Scope> Clone for CommandDef<C, T, S>
Source§fn clone(&self) -> CommandDef<C, T, S>
fn clone(&self) -> CommandDef<C, T, S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<C: Copy + Category, T: Copy + Tag, S: Copy + Scope> Copy for CommandDef<C, T, S>
Auto Trait Implementations§
impl<C, T, S> Freeze for CommandDef<C, T, S>
impl<C, T, S> RefUnwindSafe for CommandDef<C, T, S>
impl<C, T, S> Send for CommandDef<C, T, S>
impl<C, T, S> Sync for CommandDef<C, T, S>
impl<C, T, S> Unpin for CommandDef<C, T, S>
impl<C, T, S> UnsafeUnpin for CommandDef<C, T, S>where
C: UnsafeUnpin,
S: UnsafeUnpin,
impl<C, T, S> UnwindSafe for CommandDef<C, T, S>
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