#[non_exhaustive]pub enum BackendError {
DeviceOutOfMemory {
requested: u64,
available: u64,
},
UnsupportedFeature {
name: String,
backend: String,
},
PoisonedLock {
lock_error: String,
},
KernelCompileFailed {
backend: String,
compiler_message: String,
},
DispatchFailed {
code: Option<i32>,
message: String,
},
InvalidProgram {
fix: String,
},
Raw(String),
}Expand description
Actionable backend dispatch failure.
Every error that flows through the frozen VyreBackend contract must
include remediation text beginning with Fix: . This guarantees that
conform reports are directly actionable for backend authors and that
consumers never receive an opaque failure string.
Prefer specific variants (DeviceOutOfMemory, KernelCompileFailed,
etc.) over BackendError::new in new backends. The Raw variant
exists solely for backward compatibility with existing call sites.
§Examples
use vyre::BackendError;
let err = BackendError::new("adapter not found. Fix: install a compatible device driver.");
assert!(err.message().contains("Fix:"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DeviceOutOfMemory
Device ran out of memory during buffer allocation or dispatch.
Fields
UnsupportedFeature
The backend does not support a required feature.
Fields
backend: StringBackend identifier (matches crate::backend::VyreBackend::id).
PoisonedLock
Internal lock poisoning was detected during backend synchronization.
KernelCompileFailed
GPU kernel-source compilation failed.
“Shader” in the variant name is historical and generalised
- the code applies to any kernel-source compile failure across
backends. A 2.0 rename to
KernelCompileFailedis tracked in the semver-policy doc.
Fields
DispatchFailed
Command dispatch or GPU queue submission failed.
Fields
InvalidProgram
The program is structurally invalid for this backend.
Raw(String)
Fallback for backends that have not migrated to structured errors.
New backends should use a specific variant. This variant exists
solely to preserve backward compatibility with BackendError::new.
Implementations§
Source§impl BackendError
impl BackendError
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
Build a fallback BackendError::Raw after verifying the message is actionable.
If the supplied message already contains a Fix: section it is used
verbatim. Otherwise a generic fallback hint is appended. Prefer specific
variants (DeviceOutOfMemory, KernelCompileFailed, etc.) over this
constructor in new code.
§Examples
use vyre::BackendError;
let err = BackendError::new("queue full. Fix: retry with a smaller dispatch size.");
assert_eq!(err.to_string(), "queue full. Fix: retry with a smaller dispatch size.");Sourcepub fn unsupported_extension(
backend: impl Into<String>,
extension_kind: &str,
debug_identity: &str,
) -> Self
pub fn unsupported_extension( backend: impl Into<String>, extension_kind: &str, debug_identity: &str, ) -> Self
Build an actionable unsupported-extension error for opaque IR payloads.
Sourcepub fn poisoned_lock<T>(error: PoisonError<T>) -> Self
pub fn poisoned_lock<T>(error: PoisonError<T>) -> Self
Build a structured lock-poisoning error.
This constructor accepts any PoisonError from RwLock operations
and returns an actionable error carrying the root poison metadata.
Sourcepub fn message(&self) -> String
pub fn message(&self) -> String
Human-readable failure message, equivalent to ToString::to_string.
Prefer explicit match on variants or ErrorCode for programmatic
error handling; avoid string-parsing this output.
Sourcepub fn into_message(self) -> String
pub fn into_message(self) -> String
Consume this error and return its message string.
Useful in map_err chains that expect String.
Trait Implementations§
Source§impl Clone for BackendError
impl Clone for BackendError
Source§fn clone(&self) -> BackendError
fn clone(&self) -> BackendError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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()
Source§impl From<Error> for BackendError
impl From<Error> for BackendError
Source§impl PartialEq for BackendError
impl PartialEq for BackendError
Source§fn eq(&self, other: &BackendError) -> bool
fn eq(&self, other: &BackendError) -> bool
self and other values to be equal, and is used by ==.impl Eq for BackendError
impl StructuralPartialEq for BackendError
Auto Trait Implementations§
impl Freeze for BackendError
impl RefUnwindSafe for BackendError
impl Send for BackendError
impl Sync for BackendError
impl Unpin for BackendError
impl UnsafeUnpin for BackendError
impl UnwindSafe for BackendError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.