#[non_exhaustive]pub enum ReplDirective {
Help,
Load,
Quit,
Exit,
}Expand description
Framework directive available in the REPL
Deserialized from the implementation field of a directives: entry
(repl_help, repl_load, repl_quit, repl_exit). An unknown value
fails at load time, and the error lists the accepted values.
The enum is #[non_exhaustive]: later versions may add directives.
§Example
use dynamic_cli::config::ReplDirective;
assert_eq!(ReplDirective::Help.default_name(), "help");
assert_eq!(ReplDirective::Help.default_aliases(), &["h", "?"]);
assert_eq!(ReplDirective::Help.usage(), "[command]");
assert_eq!(ReplDirective::Help.as_str(), "repl_help");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Help
Show the application help, or the help of one command
Load
Run every line of a script file in the current session
Quit
Save the session history, then leave the REPL
Exit
Leave the REPL without saving the session history
Implementations§
Source§impl ReplDirective
impl ReplDirective
Sourcepub const ALL: &'static [ReplDirective]
pub const ALL: &'static [ReplDirective]
Every directive, in the order used by effective_directives and
by help listings
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Identifier used in the implementation field of the configuration
Sourcepub fn default_name(self) -> &'static str
pub fn default_name(self) -> &'static str
Name used when the configuration does not override the directive
Sourcepub fn default_aliases(self) -> &'static [&'static str]
pub fn default_aliases(self) -> &'static [&'static str]
Aliases used when the configuration does not override the directive
Sourcepub fn default_description(self) -> &'static str
pub fn default_description(self) -> &'static str
Description used when the configuration does not override the directive
Trait Implementations§
Source§impl Clone for ReplDirective
impl Clone for ReplDirective
impl Copy for ReplDirective
Source§impl Debug for ReplDirective
impl Debug for ReplDirective
Source§impl<'de> Deserialize<'de> for ReplDirective
impl<'de> Deserialize<'de> for ReplDirective
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>,
impl Eq for ReplDirective
Source§impl Hash for ReplDirective
impl Hash for ReplDirective
Source§impl PartialEq for ReplDirective
impl PartialEq for ReplDirective
Source§impl Serialize for ReplDirective
impl Serialize for ReplDirective
impl StructuralPartialEq for ReplDirective
Auto Trait Implementations§
impl Freeze for ReplDirective
impl RefUnwindSafe for ReplDirective
impl Send for ReplDirective
impl Sync for ReplDirective
impl Unpin for ReplDirective
impl UnsafeUnpin for ReplDirective
impl UnwindSafe for ReplDirective
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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