Struct gfx_device_gl::Version
source · pub struct Version {
pub is_embedded: bool,
pub major: u32,
pub minor: u32,
pub revision: Option<u32>,
pub vendor_info: &'static str,
}
Expand description
A version number for a specific component of an OpenGL implementation
Fields
is_embedded: bool
major: u32
minor: u32
revision: Option<u32>
vendor_info: &'static str
Implementations
sourceimpl Version
impl Version
sourcepub fn new(
major: u32,
minor: u32,
revision: Option<u32>,
vendor_info: &'static str
) -> Self
pub fn new(
major: u32,
minor: u32,
revision: Option<u32>,
vendor_info: &'static str
) -> Self
Create a new OpenGL version number
sourcepub fn new_embedded(major: u32, minor: u32, vendor_info: &'static str) -> Version
pub fn new_embedded(major: u32, minor: u32, vendor_info: &'static str) -> Version
Create a new OpenGL ES version number
sourcepub fn parse(src: &'static str) -> Result<Version, &'static str>
pub fn parse(src: &'static str) -> Result<Version, &'static str>
According to the OpenGL specification, the version information is expected to follow the following syntax:
<major> ::= <number>
<minor> ::= <number>
<revision> ::= <number>
<vendor-info> ::= <string>
<release> ::= <major> "." <minor> ["." <release>]
<version> ::= <release> [" " <vendor-info>]
Note that this function is intentionally lenient in regards to parsing,
and will try to recover at least the first two version numbers without
resulting in an Err
.
Trait Implementations
impl Copy for Version
impl Eq for Version
impl StructuralEq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more