gdk4_win32/
enums.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3#[cfg(feature = "v4_20")]
4use glib::translate::*;
5
6#[cfg(feature = "v4_20")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
8impl glib::error::ErrorDomain for crate::D3D12Error {
9    #[inline]
10    fn domain() -> glib::Quark {
11        unsafe { from_glib(crate::ffi::gdk_d3d12_error_quark()) }
12    }
13
14    #[inline]
15    fn code(self) -> i32 {
16        self.into_glib()
17    }
18
19    #[inline]
20    fn from(code: i32) -> Option<Self> {
21        skip_assert_initialized!();
22
23        unsafe { Some(from_glib(code)) }
24    }
25}