#[non_exhaustive]pub enum Error {
Op {
op: &'static str,
at: &'static Location<'static>,
kind: OpErrorKind,
},
OutOfMemory(usize),
Backend(String),
UnsupportedDevice(Device),
Io(String),
InvalidArgument(String),
}Expand description
Why an operation failed.
Array operations never return this directly: an invalid call yields a failed array
that carries an Error::Op (the op’s name, the caller’s source location and the
reason), and every array computed from it carries the same error. It surfaces as Err
at the boundary: crate::Array::check, crate::Array::eval,
crate::Array::item, crate::Array::to_vec, I/O and transforms. Errors that
happen while evaluating (a GPU failure, memory exhausted) use the other variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Op
An array operation rejected its arguments when it was recorded.
Fields
kind: OpErrorKindWhy it failed.
OutOfMemory(usize)
Memory for this many bytes could not be allocated (or exceeds the memory limit).
Backend(String)
The GPU backend failed (for example, a command buffer error).
UnsupportedDevice(Device)
No backend is available for the device (the GPU without Metal).
Io(String)
Reading or writing a file failed.
InvalidArgument(String)
An argument of a boundary function (transforms, loaders) is invalid.
Implementations§
Trait Implementations§
impl Eq for Error
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for Error
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§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
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> ⓘ
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> ⓘ
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