pub struct CliError {
pub message: String,
pub details: Map<String, Value>,
pub cause: Option<String>,
pub suggested_action: Option<String>,
pub documentation: Option<String>,
/* private fields */
}Fields§
§message: String§details: Map<String, Value>§cause: Option<String>§suggested_action: Option<String>§documentation: Option<String>Implementations§
Source§impl CliError
impl CliError
pub fn usage(message: impl Into<String>) -> Self
pub fn config(message: impl Into<String>) -> Self
pub fn capability(message: impl Into<String>) -> Self
pub fn backend_failure(message: impl Into<String>) -> Self
pub fn backend_protocol(message: impl Into<String>) -> Self
pub fn internal(message: impl Into<String>) -> Self
pub fn with_detail(self, key: impl Into<String>, value: Value) -> Self
pub fn with_suggested_action(self, suggested_action: impl Into<String>) -> Self
pub fn with_documentation(self, documentation: impl Into<String>) -> Self
pub const fn with_code(self, code: &'static str) -> Self
pub fn with_cause(self, cause: impl Into<String>) -> Self
pub fn with_source<E>(self, source: E) -> Selfwhere
E: Display,
pub fn kind_label(&self) -> &'static str
pub const fn exit_code(&self) -> u8
pub const fn code(&self) -> &'static str
Trait Implementations§
impl Eq for CliError
Source§impl Error for CliError
impl Error for CliError
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()
impl StructuralPartialEq for CliError
Auto Trait Implementations§
impl Forget for CliError
impl Freeze for CliError
impl Move for CliError
impl RefUnwindSafe for CliError
impl Send for CliError
impl Sync for CliError
impl Unpin for CliError
impl UnsafeUnpin for CliError
impl UnwindSafe for CliError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more