#[non_exhaustive]pub enum GpuError {
NoAdapter {
detail: String,
},
SurfaceCreation {
detail: String,
},
DeviceRequest {
detail: String,
},
DeviceLost,
Surface(SurfaceError),
Capability {
name: &'static str,
},
LimitExceeded {
resource: &'static str,
limit: u64,
},
ShaderCompile {
label: String,
detail: String,
},
Runtime {
detail: String,
},
}Expand description
Everything that can go wrong opening or driving a device.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoAdapter
No adapter satisfied the device request.
SurfaceCreation
A window or canvas could not be converted into a presentation surface.
DeviceRequest
An adapter was found but opening its logical device failed.
DeviceLost
The device was lost; recreate and retry.
Surface(SurfaceError)
The presentation surface is unavailable; reconfigure and skip the frame.
Capability
A requested capability is unavailable and no fallback applies.
LimitExceeded
A requested resource exceeds a reported portable device limit.
Fields
ShaderCompile
A shader failed to compile on this backend.
Fields
Runtime
A GPU operation failed validation or exhausted backend resources.
Implementations§
Trait Implementations§
Source§impl Error for GpuError
impl Error for GpuError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<SurfaceError> for GpuError
impl From<SurfaceError> for GpuError
Source§fn from(source: SurfaceError) -> Self
fn from(source: SurfaceError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for GpuError
impl RefUnwindSafe for GpuError
impl Send for GpuError
impl Sync for GpuError
impl Unpin for GpuError
impl UnsafeUnpin for GpuError
impl UnwindSafe for GpuError
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