pub enum ArgumentError {
MissingMandatoryFlag(String),
MissingMandatoryPositional(String),
MissingValueForName(String),
UnexpectedArgument(Spanned<String>),
UnexpectedFlag(Spanned<String>),
InvalidExternalWord,
BadValue(String),
}
Expand description
ArgumentError describes various ways that the parser could fail because of unexpected arguments. Nu commands are like a combination of functions and macros, and these errors correspond to problems that could be identified during expansion based on the syntactic signature of a command.
Variants§
MissingMandatoryFlag(String)
The command specified a mandatory flag, but it was missing.
MissingMandatoryPositional(String)
The command specified a mandatory positional argument, but it was missing.
MissingValueForName(String)
A flag was found, and it should have been followed by a value, but no value was found
UnexpectedArgument(Spanned<String>)
An argument was found, but the command does not recognize it
UnexpectedFlag(Spanned<String>)
An flag was found, but the command does not recognize it
InvalidExternalWord
A sequence of characters was found that was not syntactically valid (but would have been valid if the command was an external command)
BadValue(String)
A bad value in this location
Trait Implementations§
Source§impl Clone for ArgumentError
impl Clone for ArgumentError
Source§fn clone(&self) -> ArgumentError
fn clone(&self) -> ArgumentError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ArgumentError
impl Debug for ArgumentError
Source§impl<'de> Deserialize<'de> for ArgumentError
impl<'de> Deserialize<'de> for ArgumentError
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>,
Source§impl Hash for ArgumentError
impl Hash for ArgumentError
Source§impl Ord for ArgumentError
impl Ord for ArgumentError
Source§fn cmp(&self, other: &ArgumentError) -> Ordering
fn cmp(&self, other: &ArgumentError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ArgumentError
impl PartialEq for ArgumentError
Source§impl PartialOrd for ArgumentError
impl PartialOrd for ArgumentError
Source§impl PrettyDebug for ArgumentError
impl PrettyDebug for ArgumentError
fn pretty(&self) -> DebugDocBuilder
fn to_doc(&self) -> DebugDoc
fn pretty_doc( &self, ) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
Source§fn display(&self) -> String
fn display(&self) -> String
fn plain_string(&self, width: usize) -> String
fn colored_string(&self, width: usize) -> String
Source§impl Serialize for ArgumentError
impl Serialize for ArgumentError
impl Eq for ArgumentError
impl StructuralPartialEq for ArgumentError
Auto Trait Implementations§
impl Freeze for ArgumentError
impl RefUnwindSafe for ArgumentError
impl Send for ArgumentError
impl Sync for ArgumentError
impl Unpin for ArgumentError
impl UnwindSafe for ArgumentError
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,
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.