#[non_exhaustive]pub enum ErrorKind {
Fail(Error),
StackOverflow(Error),
Value(Error),
Function(Error),
Scope(Error),
Parser(Error),
Freeze(Error),
Internal(Error),
Native(Error),
Other(Error),
}Expand description
The different kinds of errors that can be produced by starlark
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Fail(Error)
An explicit fail invocation
StackOverflow(Error)
Starlark call stack overflow.
Value(Error)
An error approximately associated with a value.
Includes unsupported operations, missing attributes, things of that sort.
Function(Error)
Errors relating to the way a function is called (wrong number of args, etc.)
Scope(Error)
Out of scope variables and similar
Parser(Error)
Syntax error.
Freeze(Error)
Freeze errors. Should have no metadata attached
Internal(Error)
Indicates a logic bug in starlark
Native(Error)
Error from user provided native function
(but not from native functions provided by starlark crate).
When a native function declares anyhow::Result<_>
return type, it is automatically converted to this variant.
Other(Error)
Fallback option
For errors produced by starlark which have not yet been assigned their own kind
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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