#[non_exhaustive]pub enum OcasError {
ParseError {
message: String,
span: Option<(usize, usize)>,
},
DomainError {
expected: String,
found: String,
},
NumericOverflow,
UnsupportedOperation {
message: String,
},
BackendError {
backend: String,
message: String,
},
InvalidArgument {
name: String,
reason: String,
},
OutOfFuel,
}Expand description
The primary error type returned by oCAS operations.
§Example
use ocas_core::error::OcasError;
let err = OcasError::ParseError {
message: "unexpected token".into(),
span: Some((0, 3)),
};
assert_eq!(err.to_string(), "parse error at bytes 0..3: unexpected token");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.
ParseError
A parsing error with an optional source span.
Fields
DomainError
An operation was requested on an incompatible domain.
NumericOverflow
A numeric overflow or underflow occurred.
UnsupportedOperation
The requested operation is not yet implemented or supported.
BackendError
A backend library returned an error.
InvalidArgument
An invalid argument was supplied.
OutOfFuel
A resource budget (crate::fuel::Fuel) was exhausted before the
operation could complete. Retrying with a larger budget (or no budget)
will resume from scratch.
Trait Implementations§
Source§impl Error for OcasError
impl Error for OcasError
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()
impl StructuralPartialEq for OcasError
Auto Trait Implementations§
impl Freeze for OcasError
impl RefUnwindSafe for OcasError
impl Send for OcasError
impl Sync for OcasError
impl Unpin for OcasError
impl UnsafeUnpin for OcasError
impl UnwindSafe for OcasError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more