GraphicsApi

Trait GraphicsApi 

Source
pub trait GraphicsApi {
    type Device: ApiDevice;
    type Error: Error;

    // Required methods
    fn enumerate(&self, list: &mut Vec<Self::Device>) -> Result<(), Self::Error>;
    fn identifier() -> &'static str;

    // Provided method
    fn needs_enumeration(&self) -> bool { ... }
}
Available on crate feature renderer_multi only.
Expand description

A graphics api, that supports enumerating graphics devices

Required Associated Types§

Source

type Device: ApiDevice

Devices this api produces

Source

type Error: Error

Errors this api returns

Required Methods§

Source

fn enumerate(&self, list: &mut Vec<Self::Device>) -> Result<(), Self::Error>

Enumerate available devices by:

  • removing gone devices from list
  • adding new devices to list

Existing devices are guranteed to be not recreated

Source

fn identifier() -> &'static str

Unique name for representing the api type in log messages

Provided Methods§

Source

fn needs_enumeration(&self) -> bool

Method to force a re-enumeration, e.g. to free resources

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R: From<GlesRenderer> + Renderer<Error = GlesError> + Borrow<GlesRenderer>, A: AsFd + Clone + 'static> GraphicsApi for GbmGlesBackend<R, A>

Available on crate features backend_gbm and backend_egl and renderer_gl only.