mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[rs] Impl Error for Error types
This commit is contained in:
@@ -1254,10 +1254,26 @@ impl Drop for Device {
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub struct RequestDeviceError;
|
||||
|
||||
/// Error occurred when trying to async map a number.
|
||||
impl std::fmt::Display for RequestDeviceError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "Requesting a device failed")
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for RequestDeviceError {}
|
||||
|
||||
/// Error occurred when trying to async map a buffer.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub struct BufferAsyncError;
|
||||
|
||||
impl std::fmt::Display for BufferAsyncError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "Error occurred when trying to async map a buffer")
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for BufferAsyncError {}
|
||||
|
||||
/// Type of buffer mapping.
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum MapMode {
|
||||
|
||||
Reference in New Issue
Block a user