pub enum Error {
General(String),
BufferAllocationFailed {
requested_bytes: usize,
available_bytes: usize,
},
InvalidBufferHandle(usize),
ShaderCompilationError {
shader: String,
message: String,
},
DispatchLimitExceeded {
dispatch_size: usize,
limit: usize,
},
GridIndexOutOfBounds {
i: usize,
j: usize,
k: usize,
nx: usize,
ny: usize,
nz: usize,
},
KernelArgCountMismatch {
kernel: String,
expected: usize,
got: usize,
},
UnsupportedFeature {
feature: String,
},
}Expand description
Main error type for the gpu module.
Variants§
General(String)
Generic error with a free-form message.
BufferAllocationFailed
A GPU buffer allocation failed.
InvalidBufferHandle(usize)
An invalid buffer handle was used.
ShaderCompilationError
A shader compilation error (mock).
DispatchLimitExceeded
A dispatch exceeded the hardware work-group limit.
Fields
GridIndexOutOfBounds
Out-of-bounds grid access.
Fields
KernelArgCountMismatch
A kernel argument count mismatch.
Fields
UnsupportedFeature
An unsupported backend feature was requested.
Implementations§
Source§impl Error
impl Error
Sourcepub fn general(msg: impl Display) -> Self
pub fn general(msg: impl Display) -> Self
Construct a Error::General from any Display-able value.
Sourcepub fn is_allocation_error(&self) -> bool
pub fn is_allocation_error(&self) -> bool
True when this is a recoverable allocation error.
Sourcepub fn is_shader_error(&self) -> bool
pub fn is_shader_error(&self) -> bool
True when this is a shader compilation error.
Sourcepub fn is_grid_error(&self) -> bool
pub fn is_grid_error(&self) -> bool
True when this is an out-of-bounds grid error.
Sourcepub fn is_arg_mismatch(&self) -> bool
pub fn is_arg_mismatch(&self) -> bool
True when this is a kernel argument mismatch error.
Sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
True when this is an unsupported feature error.
Sourcepub fn in_stage(self, stage: impl Into<String>) -> PipelineStageError
pub fn in_stage(self, stage: impl Into<String>) -> PipelineStageError
Wrap this error in a PipelineStageError.
Sourcepub fn fatal(self, kernel: Option<&str>) -> AnnotatedError
pub fn fatal(self, kernel: Option<&str>) -> AnnotatedError
Annotate with fatal severity.
Sourcepub fn warning(self, kernel: Option<&str>) -> AnnotatedError
pub fn warning(self, kernel: Option<&str>) -> AnnotatedError
Annotate with warning severity.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
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
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