pub struct Error {
pub kind: ErrorKind,
pub(crate) span: Option<Span>,
}Fields§
§kind: ErrorKind§span: Option<Span>Implementations§
Source§impl Error
impl Error
Sourcepub fn with_span(self, span: Span) -> Self
pub fn with_span(self, span: Span) -> Self
Adds a [struct Span] to this Error, if there isn’t already a more specific one.
pub fn kind(&self) -> &ErrorKind
Sourcepub fn StackUnderflow() -> Self
pub fn StackUnderflow() -> Self
Underflowed the stack
Sourcepub fn StackOverflow(place: usize) -> Self
pub fn StackOverflow(place: usize) -> Self
Overflowed the stack
Sourcepub fn NotIterable() -> Self
pub fn NotIterable() -> Self
In clause of For loop didn’t yield a Range
Sourcepub fn NotIndexable() -> Self
pub fn NotIndexable() -> Self
A value could not be indexed
Sourcepub fn NotDefined(name: Symbol) -> Self
pub fn NotDefined(name: Symbol) -> Self
A name was not defined in scope before being used
Sourcepub fn NotInitialized(name: Symbol) -> Self
pub fn NotInitialized(name: Symbol) -> Self
A name was defined but not initialized
Sourcepub fn NotCallable(value: ConValue) -> Self
pub fn NotCallable(value: ConValue) -> Self
A value was called, but is not callable
Sourcepub fn ArgNumber(want: usize, got: usize) -> Self
pub fn ArgNumber(want: usize, got: usize) -> Self
A function was called with the wrong number of arguments
Sourcepub fn MatchNonexhaustive(value: ConValue) -> Self
pub fn MatchNonexhaustive(value: ConValue) -> Self
Fell through a non-exhaustive match
Sourcepub fn BuiltinError(msg: impl ToString) -> Self
pub fn BuiltinError(msg: impl ToString) -> Self
Error produced by a Builtin
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl !Send for Error
impl !Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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