pub enum CommandValidation {
Exact,
CommandAndFlags,
CommandOnly,
Regex(String),
AnyOf(Vec<String>),
}Expand description
How to validate a command exercise
Variants§
Exact
Exact command match (ignoring whitespace)
CommandAndFlags
Command and flags must match (args can vary)
CommandOnly
Just the base command must match
Regex(String)
Custom validation with regex
AnyOf(Vec<String>)
Multiple acceptable commands
Trait Implementations§
Source§impl Clone for CommandValidation
impl Clone for CommandValidation
Source§fn clone(&self) -> CommandValidation
fn clone(&self) -> CommandValidation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandValidation
impl Debug for CommandValidation
Source§impl<'de> Deserialize<'de> for CommandValidation
impl<'de> Deserialize<'de> for CommandValidation
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
Auto Trait Implementations§
impl Freeze for CommandValidation
impl RefUnwindSafe for CommandValidation
impl Send for CommandValidation
impl Sync for CommandValidation
impl Unpin for CommandValidation
impl UnwindSafe for CommandValidation
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