Struct nu_errors::ShellError [−][src]
pub struct ShellError {
pub error: ProximateShellError,
pub cause: Option<Box<ShellError>>,
}Expand description
A ShellError is a proximate error and a possible cause, which could have its own cause,
creating a cause chain.
Fields
error: ProximateShellErrorcause: Option<Box<ShellError>>Implementations
impl ShellError[src]
impl ShellError[src]pub fn type_error(
expected: impl Into<String>,
actual: Spanned<impl Into<String>>
) -> ShellError[src]
pub fn type_error(
expected: impl Into<String>,
actual: Spanned<impl Into<String>>
) -> ShellError[src]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[src]
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[src]
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[src]
subpath: Spanned<impl Into<String>>,
integer: impl Into<Span>
) -> ShellError
pub fn untagged_runtime_error(error: impl Into<String>) -> ShellError[src]
pub fn unexpected_eof(
expected: impl Into<String>,
span: impl Into<Span>
) -> ShellError[src]
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[src]
expected: impl Into<ExpectedRange>,
actual: &Spanned<impl Debug>,
operation: impl Into<String>
) -> ShellError
pub fn syntax_error(problem: Spanned<impl Into<String>>) -> ShellError[src]
pub fn coerce_error(
left: Spanned<impl Into<String>>,
right: Spanned<impl Into<String>>
) -> ShellError[src]
left: Spanned<impl Into<String>>,
right: Spanned<impl Into<String>>
) -> ShellError
pub fn argument_error(
command: Spanned<impl Into<String>>,
kind: ArgumentError
) -> ShellError[src]
command: Spanned<impl Into<String>>,
kind: ArgumentError
) -> ShellError
pub fn diagnostic(diagnostic: Diagnostic<usize>) -> ShellError[src]
pub fn external_non_zero() -> ShellError[src]
pub fn into_diagnostic(self) -> Option<Diagnostic<usize>>[src]
pub fn labeled_error(
msg: impl Into<String>,
label: impl Into<String>,
span: impl Into<Span>
) -> ShellError[src]
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[src]
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[src]
pub fn unexpected(title: impl Into<String>) -> ShellError[src]
pub fn is_unimplemented(&self) -> bool[src]
Trait Implementations
impl Clone for ShellError[src]
impl Clone for ShellError[src]fn clone(&self) -> ShellError[src]
fn clone(&self) -> ShellError[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for ShellError[src]
impl Debug for ShellError[src]impl<'de> Deserialize<'de> for ShellError[src]
impl<'de> Deserialize<'de> for ShellError[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]Deserialize this value from the given Serde deserializer. Read more
impl Display for ShellError[src]
impl Display for ShellError[src]impl Error for ShellError[src]
impl Error for ShellError[src]fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>[src]
fn backtrace(&self) -> Option<&Backtrace>[src]backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str1.0.0[src]
fn description(&self) -> &str1.0.0[src]use the Display impl or to_string()
impl Error for ShellError[src]
impl Error for ShellError[src]fn custom<T>(msg: T) -> Self where
T: Display, [src]
fn custom<T>(msg: T) -> Self where
T: Display, [src]Raised when there is general error when deserializing a type. Read more
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self[src]
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self[src]Raised when a Deserialize receives a type different from what it was
expecting. Read more
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self[src]
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self[src]Raised when a Deserialize receives a value of the right type but that
is wrong for some other reason. Read more
fn invalid_length(len: usize, exp: &dyn Expected) -> Self[src]
fn invalid_length(len: usize, exp: &dyn Expected) -> Self[src]Raised when deserializing a sequence or map and the input data contains too many or too few elements. Read more
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self[src]
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self[src]Raised when a Deserialize enum type received a variant with an
unrecognized name. Read more
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self[src]
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self[src]Raised when a Deserialize struct type received a field with an
unrecognized name. Read more
fn missing_field(field: &'static str) -> Self[src]
fn missing_field(field: &'static str) -> Self[src]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
fn duplicate_field(field: &'static str) -> Self[src]
fn duplicate_field(field: &'static str) -> Self[src]Raised when a Deserialize struct type received more than one of the
same field. Read more
impl From<Box<dyn Error + 'static, Global>> for ShellError[src]
impl From<Box<dyn Error + 'static, Global>> for ShellError[src]fn from(input: Box<dyn Error>) -> ShellError[src]
fn from(input: Box<dyn Error>) -> ShellError[src]Performs the conversion.
impl From<Error> for ShellError[src]
impl From<Error> for ShellError[src]fn from(input: Error) -> ShellError[src]
fn from(input: Error) -> ShellError[src]Performs the conversion.
impl From<Error> for ShellError[src]
impl From<Error> for ShellError[src]fn from(input: Error) -> ShellError[src]
fn from(input: Error) -> ShellError[src]Performs the conversion.
impl From<Error> for ShellError[src]
impl From<Error> for ShellError[src]fn from(input: Error) -> ShellError[src]
fn from(input: Error) -> ShellError[src]Performs the conversion.
impl From<Error> for ShellError[src]
impl From<Error> for ShellError[src]fn from(input: Error) -> ShellError[src]
fn from(input: Error) -> ShellError[src]Performs the conversion.
impl From<FromUtf8Error> for ShellError[src]
impl From<FromUtf8Error> for ShellError[src]fn from(input: FromUtf8Error) -> ShellError[src]
fn from(input: FromUtf8Error) -> ShellError[src]Performs the conversion.
impl From<ParseError> for ShellError[src]
impl From<ParseError> for ShellError[src]Convert a ParseError into a ShellError
fn from(error: ParseError) -> ShellError[src]
fn from(error: ParseError) -> ShellError[src]Performs the conversion.
impl From<PatternError> for ShellError[src]
impl From<PatternError> for ShellError[src]fn from(input: PatternError) -> ShellError[src]
fn from(input: PatternError) -> ShellError[src]Performs the conversion.
impl From<Utf8Error> for ShellError[src]
impl From<Utf8Error> for ShellError[src]fn from(input: Utf8Error) -> ShellError[src]
fn from(input: Utf8Error) -> ShellError[src]Performs the conversion.
impl HasFallibleSpan for ShellError[src]
impl HasFallibleSpan for ShellError[src]fn maybe_span(&self) -> Option<Span>[src]
impl Hash for ShellError[src]
impl Hash for ShellError[src]impl Ord for ShellError[src]
impl Ord for ShellError[src]impl PartialEq<ShellError> for ShellError[src]
impl PartialEq<ShellError> for ShellError[src]fn eq(&self, other: &ShellError) -> bool[src]
fn eq(&self, other: &ShellError) -> bool[src]This method tests for self and other values to be equal, and is used
by ==. Read more
fn ne(&self, other: &ShellError) -> bool[src]
fn ne(&self, other: &ShellError) -> bool[src]This method tests for !=.
impl PartialOrd<ShellError> for ShellError[src]
impl PartialOrd<ShellError> for ShellError[src]fn partial_cmp(&self, other: &ShellError) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &ShellError) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl PrettyDebug for ShellError[src]
impl PrettyDebug for ShellError[src]PrettyDebug is for internal debugging. For user-facing debugging, into_diagnostic
is used, which prints an error, highlighting spans.
fn pretty(&self) -> DebugDocBuilder[src]
fn to_doc(&self) -> DebugDoc[src]
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>[src]
fn display(&self) -> String[src]
fn display(&self) -> String[src]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[src]
fn colored_string(&self, width: usize) -> String[src]
impl Serialize for ShellError[src]
impl Serialize for ShellError[src]impl Eq for ShellError[src]
impl StructuralEq for ShellError[src]
impl StructuralPartialEq for ShellError[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> IntoSpanned for T where
T: HasFallibleSpan, [src]
impl<T> IntoSpanned for T where
T: HasFallibleSpan, [src]impl<T> PrettyDebugWithSource for T where
T: PrettyDebug, [src]
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug, [src]pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder[src]
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder[src]
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone, [src]
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>[src]
impl<T> SpannedItem for T[src]
impl<T> SpannedItem for T[src]impl<T> TaggedItem for T[src]
impl<T> TaggedItem for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,