pub enum Exception {
Failure(DeviceFailure),
Error(Seq, Seq, WorkerError),
}
Expand description
An exception to commanded execution, exposed to the client.
Variants§
Failure(DeviceFailure)
A failure is a non-deterministic problem with the underlying device or its infrastructure. For example, a controller may enter a crash loop, or its GPU may be lost
Error(Seq, Seq, WorkerError)
A deterministic problem with the user’s code. For example, an OOM resulting in trying to allocate too much GPU memory, or violating some invariant enforced by the various APIs.
Implementations§
Source§impl Exception
impl Exception
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Returns true if this is a Exception::Failure
, otherwise false
Sourcepub fn as_failure_mut(&mut self) -> Option<&mut DeviceFailure>
pub fn as_failure_mut(&mut self) -> Option<&mut DeviceFailure>
Optionally returns mutable references to the inner fields if this is a Exception::Failure
, otherwise None
Sourcepub fn as_failure(&self) -> Option<&DeviceFailure>
pub fn as_failure(&self) -> Option<&DeviceFailure>
Optionally returns references to the inner fields if this is a Exception::Failure
, otherwise None
Sourcepub fn into_failure(self) -> Result<DeviceFailure, Self>
pub fn into_failure(self) -> Result<DeviceFailure, Self>
Returns the inner fields if this is a Exception::Failure
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_error_mut(&mut self) -> Option<(&mut Seq, &mut Seq, &mut WorkerError)>
pub fn as_error_mut(&mut self) -> Option<(&mut Seq, &mut Seq, &mut WorkerError)>
Optionally returns mutable references to the inner fields if this is a Exception::Error
, otherwise None
Sourcepub fn as_error(&self) -> Option<(&Seq, &Seq, &WorkerError)>
pub fn as_error(&self) -> Option<(&Seq, &Seq, &WorkerError)>
Optionally returns references to the inner fields if this is a Exception::Error
, otherwise None
Sourcepub fn into_error(self) -> Result<(Seq, Seq, WorkerError), Self>
pub fn into_error(self) -> Result<(Seq, Seq, WorkerError), Self>
Returns the inner fields if this is a Exception::Error
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Exception
impl<'de> Deserialize<'de> for Exception
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Error for Exception
impl Error for Exception
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
Source§impl From<DeviceFailure> for Exception
impl From<DeviceFailure> for Exception
Source§fn from(source: DeviceFailure) -> Self
fn from(source: DeviceFailure) -> Self
impl StructuralPartialEq for Exception
Auto Trait Implementations§
impl Freeze for Exception
impl RefUnwindSafe for Exception
impl Send for Exception
impl Sync for Exception
impl Unpin for Exception
impl UnwindSafe for Exception
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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