summaryrefslogtreecommitdiffstats
path: root/third_party/rust/gpu-allocator/src/result.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/rust/gpu-allocator/src/result.rs
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/gpu-allocator/src/result.rs')
-rw-r--r--third_party/rust/gpu-allocator/src/result.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/third_party/rust/gpu-allocator/src/result.rs b/third_party/rust/gpu-allocator/src/result.rs
new file mode 100644
index 0000000000..7d5336d582
--- /dev/null
+++ b/third_party/rust/gpu-allocator/src/result.rs
@@ -0,0 +1,21 @@
+use thiserror::Error;
+
+#[derive(Error, Debug)]
+pub enum AllocationError {
+ #[error("Out of memory")]
+ OutOfMemory,
+ #[error("Failed to map memory: {0}")]
+ FailedToMap(String),
+ #[error("No compatible memory type available")]
+ NoCompatibleMemoryTypeFound,
+ #[error("Invalid AllocationCreateDesc")]
+ InvalidAllocationCreateDesc,
+ #[error("Invalid AllocatorCreateDesc {0}")]
+ InvalidAllocatorCreateDesc(String),
+ #[error("Internal error: {0}")]
+ Internal(String),
+ #[error("Initial `BARRIER_LAYOUT` needs `Device10`")]
+ BarrierLayoutNeedsDevice10,
+}
+
+pub type Result<V, E = AllocationError> = ::std::result::Result<V, E>;