pub struct DirectiveDefinition {
pub implementation: ReplDirective,
pub name: String,
pub aliases: Vec<String>,
pub description: String,
}Expand description
Name, aliases and description of a REPL directive
Used both for the entries of the directives: configuration section and
for the complete table returned by effective_directives.
§Example YAML
implementation: repl_quit
name: quitter
aliases: [q]
description: "Enregistrer l'historique et quitter"Fields§
§implementation: ReplDirectiveDirective being defined or overridden
name: StringName typed after : to invoke the directive
aliases: Vec<String>Alternative names, also typed after :
description: StringHuman-readable description for help text
Implementations§
Source§impl DirectiveDefinition
impl DirectiveDefinition
Sourcepub fn default_for(directive: ReplDirective) -> Self
pub fn default_for(directive: ReplDirective) -> Self
Definition of directive with its default name, aliases and
description
§Example
use dynamic_cli::config::{DirectiveDefinition, ReplDirective};
let quit = DirectiveDefinition::default_for(ReplDirective::Quit);
assert_eq!(quit.name, "quit");
assert_eq!(quit.aliases, vec!["q".to_string()]);Trait Implementations§
Source§impl Clone for DirectiveDefinition
impl Clone for DirectiveDefinition
Source§impl Debug for DirectiveDefinition
impl Debug for DirectiveDefinition
Source§impl<'de> Deserialize<'de> for DirectiveDefinition
impl<'de> Deserialize<'de> for DirectiveDefinition
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 DirectiveDefinition
impl PartialEq for DirectiveDefinition
Source§impl Serialize for DirectiveDefinition
impl Serialize for DirectiveDefinition
impl StructuralPartialEq for DirectiveDefinition
Auto Trait Implementations§
impl Freeze for DirectiveDefinition
impl RefUnwindSafe for DirectiveDefinition
impl Send for DirectiveDefinition
impl Sync for DirectiveDefinition
impl Unpin for DirectiveDefinition
impl UnsafeUnpin for DirectiveDefinition
impl UnwindSafe for DirectiveDefinition
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