Struct gfx_device_gl::Version [] [src]

pub struct Version {
    pub major: u32,
    pub minor: u32,
    pub revision: Option<u32>,
    pub vendor_info: &'static str,
}

A version number for a specific component of an OpenGL implementation

Fields

major
minor
revision
vendor_info

Methods

impl Version

fn new(major: u32, minor: u32, revision: Option<u32>, vendor_info: &'static str) -> Version

Create a new OpenGL version number

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 Debug for Version

fn fmt(&self, f: &mut Formatter) -> Result

Derived Implementations

impl PartialOrd for Version

fn partial_cmp(&self, __arg_0: &Version) -> Option<Ordering>

fn lt(&self, __arg_0: &Version) -> bool

fn le(&self, __arg_0: &Version) -> bool

fn gt(&self, __arg_0: &Version) -> bool

fn ge(&self, __arg_0: &Version) -> bool

impl PartialEq for Version

fn eq(&self, __arg_0: &Version) -> bool

fn ne(&self, __arg_0: &Version) -> bool

impl Ord for Version

fn cmp(&self, __arg_0: &Version) -> Ordering

impl Eq for Version

impl Clone for Version

fn clone(&self) -> Version

1.0.0fn clone_from(&mut self, source: &Self)

impl Copy for Version