pub struct Version {
pub major: u32,
pub minor: u32,
pub is_embedded: bool,
pub revision: Option<u32>,
pub vendor_info: String,
}
Expand description
A version number for a specific component of an OpenGL implementation
Fields§
§major: u32
§minor: u32
§is_embedded: bool
§revision: Option<u32>
§vendor_info: String
Implementations§
source§impl Version
impl Version
sourcepub(crate) fn new(
major: u32,
minor: u32,
revision: Option<u32>,
vendor_info: String,
) -> Self
pub(crate) fn new( major: u32, minor: u32, revision: Option<u32>, vendor_info: String, ) -> Self
Create a new OpenGL version number
sourcepub(crate) fn new_embedded(major: u32, minor: u32, vendor_info: String) -> Self
pub(crate) fn new_embedded(major: u32, minor: u32, vendor_info: String) -> Self
Create a new OpenGL ES version number
sourcepub(crate) fn parse(src: &str) -> Result<Version, &str>
pub(crate) fn parse(src: &str) -> Result<Version, &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
.
§Notes
WebGL 2
version returned as OpenGL ES 3.0
Trait Implementations§
source§impl Ord for Version
impl Ord for Version
source§impl PartialEq for Version
impl PartialEq for Version
source§impl PartialOrd for Version
impl PartialOrd for Version
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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 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