pub struct CommandsConfig {
pub metadata: Metadata,
pub commands: Vec<CommandDefinition>,
pub global_options: Vec<OptionDefinition>,
pub directives: Vec<DirectiveDefinition>,
}Expand description
Complete configuration for CLI/REPL commands
This is the root structure deserialized from YAML/JSON files. It contains metadata about the interface and all command definitions.
§Example YAML
metadata:
version: "1.0.0"
prompt: "myapp"
prompt_suffix: " > "
commands:
- name: hello
description: "Say hello"
# ... more fields
global_options: []
directives:
- implementation: repl_help
name: aide
description: "Afficher l'aide"Fields§
§metadata: MetadataMetadata about the application interface
commands: Vec<CommandDefinition>List of all available commands
global_options: Vec<OptionDefinition>Global options available to all commands
directives: Vec<DirectiveDefinition>Overrides of the REPL directives (:help, :quit…)
Each entry replaces the name, aliases and description of the
directive selected by its implementation; directives without an
entry keep their defaults. Empty when the section is absent. See
crate::config::directive.
Trait Implementations§
Source§impl Clone for CommandsConfig
impl Clone for CommandsConfig
Source§impl Debug for CommandsConfig
impl Debug for CommandsConfig
Source§impl<'de> Deserialize<'de> for CommandsConfig
impl<'de> Deserialize<'de> for CommandsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandsConfig
impl PartialEq for CommandsConfig
Source§impl Serialize for CommandsConfig
impl Serialize for CommandsConfig
impl StructuralPartialEq for CommandsConfig
Auto Trait Implementations§
impl Freeze for CommandsConfig
impl RefUnwindSafe for CommandsConfig
impl Send for CommandsConfig
impl Sync for CommandsConfig
impl Unpin for CommandsConfig
impl UnsafeUnpin for CommandsConfig
impl UnwindSafe for CommandsConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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