Enum nu_errors::ArgumentError
source · [−]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
sourceimpl Clone for ArgumentError
impl Clone for ArgumentError
sourcefn clone(&self) -> ArgumentError
fn clone(&self) -> ArgumentError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ArgumentError
impl Debug for ArgumentError
sourceimpl<'de> Deserialize<'de> for ArgumentError
impl<'de> Deserialize<'de> for ArgumentError
sourcefn 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
sourceimpl Hash for ArgumentError
impl Hash for ArgumentError
sourceimpl Ord for ArgumentError
impl Ord for ArgumentError
sourceimpl PartialEq<ArgumentError> for ArgumentError
impl PartialEq<ArgumentError> for ArgumentError
sourcefn eq(&self, other: &ArgumentError) -> bool
fn eq(&self, other: &ArgumentError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ArgumentError) -> bool
fn ne(&self, other: &ArgumentError) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ArgumentError> for ArgumentError
impl PartialOrd<ArgumentError> for ArgumentError
sourcefn partial_cmp(&self, other: &ArgumentError) -> Option<Ordering>
fn partial_cmp(&self, other: &ArgumentError) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl 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>
sourcefn display(&self) -> String
fn display(&self) -> String
A convenience method that prints out the document without colors in 70 columns. Generally, you should use plain_string or colored_string if possible, but display() can be useful for trace lines and things like that, where you don’t have control over the terminal. Read more
fn plain_string(&self, width: usize) -> String
fn colored_string(&self, width: usize) -> String
sourceimpl Serialize for ArgumentError
impl Serialize for ArgumentError
impl Eq for ArgumentError
impl StructuralEq for ArgumentError
impl StructuralPartialEq for ArgumentError
Auto Trait Implementations
impl RefUnwindSafe for ArgumentError
impl Send for ArgumentError
impl Sync for ArgumentError
impl Unpin for ArgumentError
impl UnwindSafe for ArgumentError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> PrettyDebugWithSource for T where
T: PrettyDebug,
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug,
pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>
sourceimpl<T> SpannedItem for T
impl<T> SpannedItem for T
sourceimpl<T> TaggedItem for T
impl<T> TaggedItem for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more