pub struct Command {
pub name: &'static str,
pub summary: &'static str,
pub detail: &'static str,
pub params: &'static [Param],
pub cli_only: Option<&'static str>,
pub writes: Writes,
pub run: fn(&mut Context, &Arguments) -> Result<Outcome, Failed>,
}Expand description
One command.
Fields§
§name: &'static strThe verb, as inillucent <name> and as inillucent_<name>.
summary: &'static strOne line, shown in the command list and used as the MCP description.
detail: &'static strThe longer explanation, shown by inillucent help <name> and appended
to the MCP description so a model reads the same thing a person does.
params: &'static [Param]What it takes.
cli_only: Option<&'static str>Why it is not offered over MCP, when it is not.
writes: WritesWhether it can change the database, and what a read only surface does about it.
run: fn(&mut Context, &Arguments) -> Result<Outcome, Failed>What it does.
Implementations§
Source§impl Command
impl Command
Sourcepub fn param(&self, name: &str) -> Option<&'static Param>
pub fn param(&self, name: &str) -> Option<&'static Param>
Returns this command’s parameter of a given name.
@param name - the parameter name
Sourcepub fn positional(&self) -> Option<&'static Param>
pub fn positional(&self) -> Option<&'static Param>
Returns the parameter that may be written without its name.
Sourcepub fn allowed_values(&self, name: &str) -> Option<&'static [&'static str]>
pub fn allowed_values(&self, name: &str) -> Option<&'static [&'static str]>
Returns the finite text values a parameter accepts when it has any.
@param name - the parameter name
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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