Skip to content

Commit 7a73c75

Browse files
sagudevcwfitzgerald
authored andcommitted
Make RequestDeviceError (de)serializable
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
1 parent 56d418f commit 7a73c75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wgpu-core/src/instance.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type HalInstance<A> = <A as hal::Api>::Instance;
2323
type HalSurface<A> = <A as hal::Api>::Surface;
2424

2525
#[derive(Clone, Debug, Error)]
26+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2627
#[error("Limit '{name}' value {requested} is better than allowed {allowed}")]
2728
pub struct FailedLimit {
2829
name: &'static str,
@@ -391,6 +392,8 @@ pub enum GetSurfaceSupportError {
391392
}
392393

393394
#[derive(Clone, Debug, Error)]
395+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
396+
#[cfg_attr(feature = "serde", serde(bound(deserialize = "'de: 'static")))]
394397
/// Error when requesting a device from the adaptor
395398
#[non_exhaustive]
396399
pub enum RequestDeviceError {

0 commit comments

Comments
 (0)