pub struct Version {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
Decoded Vulkan API version (major.minor.patch).
Vulkan packs versions into a u32: major (bits 31-22), minor (21-12),
patch (11-0). This type provides named fields and a Display impl.
§Examples
use vulkan_rust::Version;
let v = Version::from_raw(0x00403000);
assert_eq!(v.to_string(), "1.3.0");
assert_eq!(v.to_raw(), 0x00403000);Fields§
§major: u32Major version number (bits 31-22 of the packed u32).
minor: u32Minor version number (bits 21-12 of the packed u32).
patch: u32Patch version number (bits 11-0 of the packed u32).
Implementations§
Source§impl Version
impl Version
Sourcepub const fn new(major: u32, minor: u32, patch: u32) -> Self
pub const fn new(major: u32, minor: u32, patch: u32) -> Self
Create a version from major, minor, and patch components.
use vulkan_rust::Version;
let v = Version::new(1, 3, 0);
assert_eq!(v.to_raw(), 0x00403000);
assert_eq!(v.to_string(), "1.3.0");Trait Implementations§
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Copy for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnsafeUnpin for Version
impl UnwindSafe for Version
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more