#[non_exhaustive]pub enum ConsoleError {
BadUsage(String),
UnclosedQuote,
UnknownCommand(String),
MissingArgument {
usage: String,
argument: String,
},
TooManyArguments {
usage: String,
},
InvalidArgument {
usage: String,
argument: String,
found: String,
expected: String,
},
Failed(String),
}Expand description
Why the console did not run a line, or a command failed: the console prints it in red.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BadUsage(String)
A command registered with a usage that does not start with its
name: empty, a placeholder, a quote, or help, the console’s own.
UnclosedQuote
A line with a quote that is not closed.
UnknownCommand(String)
A line whose first word is no command’s.
MissingArgument
A line short of an argument its command’s usage needs.
Fields
TooManyArguments
A line with more arguments than its command’s usage has.
InvalidArgument
An argument that is not what its command takes.
Fields
Failed(String)
A command that ran and failed, and why.
Trait Implementations§
Source§impl Clone for ConsoleError
impl Clone for ConsoleError
Source§impl Debug for ConsoleError
impl Debug for ConsoleError
Source§impl Display for ConsoleError
impl Display for ConsoleError
impl Eq for ConsoleError
Source§impl Error for ConsoleError
impl Error for ConsoleError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ConsoleError
impl PartialEq for ConsoleError
impl StructuralPartialEq for ConsoleError
Auto Trait Implementations§
impl Forget for ConsoleError
impl Freeze for ConsoleError
impl Move for ConsoleError
impl RefUnwindSafe for ConsoleError
impl Send for ConsoleError
impl Sync for ConsoleError
impl Unpin for ConsoleError
impl UnsafeUnpin for ConsoleError
impl UnwindSafe for ConsoleError
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