pub struct DeviceErrorState { /* private fields */ }Expand description
Errors reported by wgpu’s device-wide callbacks.
A device has exactly one lost callback and one uncaptured-error callback, so this state is installed once per device and shared by every renderer using it. Renderers keep their own handle so they can keep observing a loss after the context that produced it has been dropped for recovery.
Implementations§
Source§impl DeviceErrorState
impl DeviceErrorState
Sourcepub fn device_lost(&self) -> bool
pub fn device_lost(&self) -> bool
Returns true if the GPU device was lost (e.g., due to driver crash, suspend/resume).
Sourcepub fn observe_error(&self, generation: &mut u64) -> Option<String>
pub fn observe_error(&self, generation: &mut u64) -> Option<String>
Returns the latest error once per observer, without consuming shared state. Start each observer at zero, including after switching devices, so errors raised during construction are observed. Multiple errors between observations coalesce into the latest error; this is not an error queue.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DeviceErrorState
impl !RefUnwindSafe for DeviceErrorState
impl Send for DeviceErrorState
impl Sync for DeviceErrorState
impl Unpin for DeviceErrorState
impl UnsafeUnpin for DeviceErrorState
impl UnwindSafe for DeviceErrorState
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().