pub enum UnifiedError {
Allocation(String),
Cuda(String),
ZeroSize,
TooLarge {
requested: u64,
limit: u64,
},
NotSupported {
feature: &'static str,
backing: &'static str,
},
}Expand description
Errors raised by UnifiedBuffer operations.
Variants§
Allocation(String)
The underlying allocator failed.
Cuda(String)
A CUDA API call failed.
ZeroSize
Zero-byte allocation requested (not supported).
TooLarge
Requested allocation exceeds the configured / hard-coded cap.
Distinct from UnifiedError::Allocation so callers can plumb
structured requested / limit figures all the way through to
tensor_wasm_core::error::TensorWasmError::MemoryExhausted without
resorting to substring-matching on a message.
NotSupported
A UnifiedBacking method is not available on the active backing.
Surfaced by trait methods (e.g. prefetch_to_device on the cudarc
stub or the Box<[u8]> host fallback) when the underlying backing
has no implementation. Carries the method name and the backing tag
so operator tooling and tests can match on the exact gap without
scraping driver error strings.
Trait Implementations§
Source§impl Debug for UnifiedError
impl Debug for UnifiedError
Source§impl Display for UnifiedError
impl Display for UnifiedError
Source§impl Error for UnifiedError
impl Error for UnifiedError
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<UnifiedError> for TensorWasmError
Cross-crate conversion so tensor-wasm-mem errors flow into the workspace’s
unified TensorWasmError type without manual mapping at every call site.
impl From<UnifiedError> for TensorWasmError
Cross-crate conversion so tensor-wasm-mem errors flow into the workspace’s
unified TensorWasmError type without manual mapping at every call site.
ZeroSize→TensorWasmError::Serializationwith a descriptive message (zero-byte allocations are caller bugs, not memory exhaustion).Allocation { .. }→TensorWasmError::Serializationcarrying the detail string. Exhaustion is NOT routed through this variant — pool / buffer exhaustion is reported as the structuredUnifiedError::TooLarge { requested, limit }instead, which maps directly toMemoryExhaustedbelow. Any remainingAllocationpayload reaching this conversion is a caller bug (e.g.minimum > maximum, bad alignment) and is surfaced asSerializationaccordingly.TooLarge { requested, limit }→TensorWasmError::MemoryExhausted { requested, limit }(1:1, structured).Cuda { .. }→TensorWasmError::CudaError(1:1 mapping).
Source§fn from(e: UnifiedError) -> Self
fn from(e: UnifiedError) -> Self
Auto Trait Implementations§
impl Freeze for UnifiedError
impl RefUnwindSafe for UnifiedError
impl Send for UnifiedError
impl Sync for UnifiedError
impl Unpin for UnifiedError
impl UnsafeUnpin for UnifiedError
impl UnwindSafe for UnifiedError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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