mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
[rs] Impl Error for Error types
This commit is contained in:
1 parent
ee69f3c457
commit
90ebe377df
1 file changed
+17
-1
+17
-1
@@ -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