pub enum BackendError {
NotSupported(String),
InvalidArgument(String),
ExecutionFailed(String),
}Expand description
Error originating from a compute backend.
All variants represent conditions detected by or attributed to the backend.
Linalg-layer validation (nrow range, square matrix checks, etc.) should use
a separate error mechanism, not BackendError.
Every variant carries its full context in its own Display message; none
wraps a structured inner error. BackendError is therefore a leaf in the
error chain — its source() is always None.
Variants§
NotSupported(String)
The backend does not support this operation.
Returned when an operation is fundamentally unavailable on this backend (e.g., a GPU backend that lacks an eigenvalue solver). Upper layers should consider fallback strategies or alternative computation paths.
InvalidArgument(String)
The descriptor passed to the backend violates its contract.
This indicates a bug in the calling layer (typically linalg), not a user error. For example, buffer sizes inconsistent with declared dimensions. Callers should treat this as a panic-worthy condition in debug builds.
ExecutionFailed(String)
The computation failed at runtime.
The operation was supported and the arguments were valid, but execution failed due to numerical issues, resource exhaustion, or other runtime conditions (e.g., a matrix factorization that fails to converge).
Trait Implementations§
Source§impl Debug for BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
Source§impl Error for BackendError
impl Error for BackendError
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()