i_slint_core::api

Enum GraphicsAPI

Source
#[non_exhaustive]
pub enum GraphicsAPI<'a> { NativeOpenGL { get_proc_address: &'a dyn Fn(&CStr) -> *const c_void, }, WebGL { canvas_element_id: &'a str, context_type: &'a str, }, }
Expand description

This enum describes a low-level access to specific graphics APIs used by the renderer.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NativeOpenGL

The rendering is done using OpenGL.

Fields

§get_proc_address: &'a dyn Fn(&CStr) -> *const c_void

Use this function pointer to obtain access to the OpenGL implementation - similar to eglGetProcAddress.

§

WebGL

The rendering is done on a HTML Canvas element using WebGL.

Fields

§canvas_element_id: &'a str

The DOM element id of the HTML Canvas element used for rendering.

§context_type: &'a str

The drawing context type used on the HTML Canvas element for rendering. This is the argument to the getContext function on the HTML Canvas element.

Trait Implementations§

Source§

impl<'a> Clone for GraphicsAPI<'a>

Source§

fn clone(&self) -> GraphicsAPI<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for GraphicsAPI<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GraphicsAPI<'a>

§

impl<'a> !RefUnwindSafe for GraphicsAPI<'a>

§

impl<'a> !Send for GraphicsAPI<'a>

§

impl<'a> !Sync for GraphicsAPI<'a>

§

impl<'a> Unpin for GraphicsAPI<'a>

§

impl<'a> !UnwindSafe for GraphicsAPI<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.