Struct nu_errors::ShellError
source · [−]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
sourceimpl 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
sourceimpl Clone for ShellError
impl Clone for ShellError
sourcefn clone(&self) -> ShellError
fn clone(&self) -> ShellError
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 ShellError
impl Debug for ShellError
sourceimpl<'de> Deserialize<'de> for ShellError
impl<'de> Deserialize<'de> for ShellError
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 Display for ShellError
impl Display for ShellError
sourceimpl Error for ShellError
impl Error for ShellError
sourcefn custom<T>(msg: T) -> Self where
T: Display,
fn custom<T>(msg: T) -> Self where
T: Display,
Raised when there is general error when deserializing a type. Read more
sourcefn 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 more
sourcefn 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 more
sourcefn 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
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourceimpl Error for ShellError
impl Error for ShellError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<Box<dyn Error + 'static, Global>> for ShellError
impl From<Box<dyn Error + 'static, Global>> for ShellError
sourcefn from(input: Box<dyn Error>) -> ShellError
fn from(input: Box<dyn Error>) -> ShellError
Performs the conversion.
sourceimpl From<Error> for ShellError
impl From<Error> for ShellError
sourcefn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Performs the conversion.
sourceimpl From<Error> for ShellError
impl From<Error> for ShellError
sourcefn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Performs the conversion.
sourceimpl From<Error> for ShellError
impl From<Error> for ShellError
sourcefn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Performs the conversion.
sourceimpl From<Error> for ShellError
impl From<Error> for ShellError
sourcefn from(input: Error) -> ShellError
fn from(input: Error) -> ShellError
Performs the conversion.
sourceimpl From<FromUtf8Error> for ShellError
impl From<FromUtf8Error> for ShellError
sourcefn from(input: FromUtf8Error) -> ShellError
fn from(input: FromUtf8Error) -> ShellError
Performs the conversion.
sourceimpl From<ParseError> for ShellError
impl From<ParseError> for ShellError
Convert a ParseError into a ShellError
sourcefn from(error: ParseError) -> ShellError
fn from(error: ParseError) -> ShellError
Performs the conversion.
sourceimpl From<PatternError> for ShellError
impl From<PatternError> for ShellError
sourcefn from(input: PatternError) -> ShellError
fn from(input: PatternError) -> ShellError
Performs the conversion.
sourceimpl From<Utf8Error> for ShellError
impl From<Utf8Error> for ShellError
sourcefn from(input: Utf8Error) -> ShellError
fn from(input: Utf8Error) -> ShellError
Performs the conversion.
sourceimpl HasFallibleSpan for ShellError
impl HasFallibleSpan for ShellError
fn maybe_span(&self) -> Option<Span>
sourceimpl Hash for ShellError
impl Hash for ShellError
sourceimpl Ord for ShellError
impl Ord for ShellError
sourceimpl PartialEq<ShellError> for ShellError
impl PartialEq<ShellError> for ShellError
sourcefn eq(&self, other: &ShellError) -> bool
fn eq(&self, other: &ShellError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ShellError) -> bool
fn ne(&self, other: &ShellError) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ShellError> for ShellError
impl PartialOrd<ShellError> for ShellError
sourcefn partial_cmp(&self, other: &ShellError) -> Option<Ordering>
fn partial_cmp(&self, other: &ShellError) -> 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 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>
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 ShellError
impl Serialize for ShellError
impl Eq for ShellError
impl StructuralEq for ShellError
impl StructuralPartialEq for ShellError
Auto Trait Implementations
impl RefUnwindSafe for ShellError
impl Send for ShellError
impl Sync for ShellError
impl Unpin for ShellError
impl UnwindSafe for ShellError
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> IntoSpanned for T where
T: HasFallibleSpan,
impl<T> IntoSpanned for T where
T: HasFallibleSpan,
type Output = T
pub fn into_spanned(self, _span: impl Into<Span>) -> <T as IntoSpanned>::Output
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