pub enum CommandError {
Reported {
message: String,
exit_code: i32,
hint: Option<String>,
source: Option<Error>,
},
Cancelled,
Fatal(String),
}Variants§
Implementations§
Source§impl CommandError
impl CommandError
pub fn reported(message: impl Into<String>) -> Self
pub fn cancelled() -> Self
pub fn fatal(message: impl Into<String>) -> Self
pub fn with_hint(self, hint: impl Into<String>) -> Self
pub fn with_exit_code(self, exit_code: i32) -> Self
pub fn with_source(self, source: Option<Error>) -> Self
pub fn as_reported(&self) -> Option<(&str, i32, Option<&str>)>
pub fn exit_code(&self) -> i32
pub fn is_fatal(&self) -> bool
pub fn hint(&self) -> Option<&str>
Trait Implementations§
Source§impl Debug for CommandError
impl Debug for CommandError
Source§impl Display for CommandError
impl Display for CommandError
Source§impl Error for CommandError
impl Error for CommandError
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 From<&CommandError> for ExitCode
impl From<&CommandError> for ExitCode
Source§fn from(err: &CommandError) -> Self
fn from(err: &CommandError) -> Self
Converts to this type from the input type.
Source§impl From<CommandError> for ExitCode
impl From<CommandError> for ExitCode
Source§fn from(err: CommandError) -> Self
fn from(err: CommandError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CommandError
impl PartialEq for CommandError
impl Eq for CommandError
Auto Trait Implementations§
impl Freeze for CommandError
impl RefUnwindSafe for CommandError
impl Send for CommandError
impl Sync for CommandError
impl Unpin for CommandError
impl UnwindSafe for CommandError
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.