[][src]Struct piston_window::Api

pub struct Api {
    pub api: Cow<'static, str>,
    pub major: u32,
    pub minor: u32,
}

Stores graphics API version.

Fields

api: Cow<'static, str>

A string identifying the API.

major: u32

Major version.

minor: u32

Minor version.

Methods

impl Version[src]

pub fn opengl(major: u32, minor: u32) -> Version[src]

Creates a new OpenGL version.

pub fn vulkan(major: u32, minor: u32) -> Version[src]

Creates a new Vulkan version.

pub fn directx(major: u32, minor: u32) -> Version[src]

Creates a new DirectX version.

pub fn metal(major: u32, minor: u32) -> Version[src]

Creates a new Metal version.

pub fn is_opengl(&self) -> bool[src]

Returns true if the API is OpenGL, false otherwise.

pub fn is_vulkan(&self) -> bool[src]

Returns true if the API is Vulkan, false otherwise.

pub fn is_directx(&self) -> bool[src]

Returns true if the API is DirectX, false otherwise.

pub fn is_metal(&self) -> bool[src]

Returns true if the API is metal, false otherwise.

Trait Implementations

impl PartialEq<Version> for Version[src]

impl Clone for Version[src]

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

Performs copy-assignment from source. Read more

impl PartialOrd<Version> for Version[src]

impl Ord for Version[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Eq for Version[src]

impl Debug for Version[src]

impl Into<Version> for OpenGL[src]

Auto Trait Implementations

impl Send for Version

impl Sync for Version

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.

impl<T> Erased for T[src]