Merge pull request #101 from Ralith/raw-enums
Expose conversions between enums and raw values
This commit is contained in:
commit
2f60f8f1d5
4498
ash/src/vk.rs
4498
ash/src/vk.rs
File diff suppressed because it is too large
Load diff
|
@ -1037,6 +1037,10 @@ pub fn generate_enum<'a>(
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct #ident(pub(crate) i32);
|
pub struct #ident(pub(crate) i32);
|
||||||
|
impl #ident {
|
||||||
|
pub fn from_raw(x: i32) -> Self { #ident(x) }
|
||||||
|
pub fn as_raw(self) -> i32 { self.0 }
|
||||||
|
}
|
||||||
#impl_block
|
#impl_block
|
||||||
};
|
};
|
||||||
let special_quote = match _name.as_str() {
|
let special_quote = match _name.as_str() {
|
||||||
|
|
Loading…
Reference in a new issue