pub struct ShellError {
pub error: ProximateShellError,
pub notes: Vec<String>,
}
Expand description
A ShellError
is a proximate error and a possible cause, which could have its own cause,
creating a cause chain.
Fields§
§error: ProximateShellError
§notes: Vec<String>
Implementations§
Source§impl ShellError
impl ShellError
Sourcepub fn type_error(
expected: impl Into<String>,
actual: Spanned<impl Into<String>>,
) -> ShellError
pub fn type_error( expected: impl Into<String>, actual: Spanned<impl Into<String>>, ) -> ShellError
An error that describes a mismatch between the given type and the expected type
pub fn missing_property( subpath: Spanned<impl Into<String>>, expr: Spanned<impl Into<String>>, ) -> ShellError
pub fn missing_value( span: impl Into<Option<Span>>, reason: impl Into<String>, ) -> ShellError
pub fn invalid_integer_index( subpath: Spanned<impl Into<String>>, integer: impl Into<Span>, ) -> ShellError
pub fn untagged_runtime_error(error: impl Into<String>) -> ShellError
pub fn unexpected_eof( expected: impl Into<String>, span: impl Into<Span>, ) -> ShellError
pub fn range_error( expected: impl Into<ExpectedRange>, actual: &Spanned<impl Debug>, operation: impl Into<String>, ) -> ShellError
pub fn syntax_error(problem: Spanned<impl Into<String>>) -> ShellError
pub fn coerce_error( left: Spanned<impl Into<String>>, right: Spanned<impl Into<String>>, ) -> ShellError
pub fn argument_error( command: Spanned<impl Into<String>>, kind: ArgumentError, ) -> ShellError
pub fn diagnostic(diagnostic: Diagnostic<usize>) -> ShellError
pub fn into_diagnostic(self) -> Diagnostic<usize>
pub fn labeled_error( msg: impl Into<String>, label: impl Into<String>, span: impl Into<Span>, ) -> ShellError
pub fn labeled_error_with_secondary( msg: impl Into<String>, primary_label: impl Into<String>, primary_span: impl Into<Span>, secondary_label: impl Into<String>, secondary_span: impl Into<Span>, ) -> ShellError
pub fn unimplemented(title: impl Into<String>) -> ShellError
pub fn unexpected(title: impl Into<String>) -> ShellError
pub fn is_unimplemented(&self) -> bool
Trait Implementations§
Source§impl Clone for ShellError
impl Clone for ShellError
Source§fn clone(&self) -> ShellError
fn clone(&self) -> ShellError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ShellError
impl Debug for ShellError
Source§impl<'de> Deserialize<'de> for ShellError
impl<'de> Deserialize<'de> for ShellError
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ShellError
impl Display for ShellError
Source§impl Error for ShellError
impl Error for ShellError
Source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
Raised when there is general error when deserializing a type. Read more
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Raised when deserializing a sequence or map and the input data contains
too many or too few elements. Read more
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type received more than one of the
same field.Source§impl Error for ShellError
impl Error for ShellError
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 From<Error> for ShellError
impl From<Error> for ShellError
Source§fn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Converts to this type from the input type.
Source§impl From<Error> for ShellError
impl From<Error> for ShellError
Source§fn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Converts to this type from the input type.
Source§impl From<Error> for ShellError
impl From<Error> for ShellError
Source§fn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Converts to this type from the input type.
Source§impl From<Error> for ShellError
impl From<Error> for ShellError
Source§fn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Converts to this type from the input type.
Source§impl From<FromUtf8Error> for ShellError
impl From<FromUtf8Error> for ShellError
Source§fn from(input: FromUtf8Error) -> ShellError
fn from(input: FromUtf8Error) -> ShellError
Converts to this type from the input type.
Source§impl From<ParseError> for ShellError
impl From<ParseError> for ShellError
Convert a ParseError into a ShellError
Source§fn from(error: ParseError) -> ShellError
fn from(error: ParseError) -> ShellError
Converts to this type from the input type.
Source§impl From<PatternError> for ShellError
impl From<PatternError> for ShellError
Source§fn from(input: PatternError) -> ShellError
fn from(input: PatternError) -> ShellError
Converts to this type from the input type.
Source§impl From<Utf8Error> for ShellError
impl From<Utf8Error> for ShellError
Source§fn from(input: Utf8Error) -> ShellError
fn from(input: Utf8Error) -> ShellError
Converts to this type from the input type.
Source§impl HasFallibleSpan for ShellError
impl HasFallibleSpan for ShellError
fn maybe_span(&self) -> Option<Span>
Source§impl Hash for ShellError
impl Hash for ShellError
Source§impl Ord for ShellError
impl Ord for ShellError
Source§fn cmp(&self, other: &ShellError) -> Ordering
fn cmp(&self, other: &ShellError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ShellError
impl PartialEq for ShellError
Source§impl PartialOrd for ShellError
impl PartialOrd for ShellError
Source§impl PrettyDebug for ShellError
impl PrettyDebug for ShellError
PrettyDebug
is for internal debugging. For user-facing debugging, into_diagnostic
is used, which prints an error, highlighting spans.
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
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.
fn plain_string(&self, width: usize) -> String
fn colored_string(&self, width: usize) -> String
Source§impl Serialize for ShellError
impl Serialize for ShellError
impl Eq for ShellError
impl StructuralPartialEq for ShellError
Auto Trait Implementations§
impl Freeze for ShellError
impl RefUnwindSafe for ShellError
impl Send for ShellError
impl Sync for ShellError
impl Unpin for ShellError
impl UnwindSafe for ShellError
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
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.