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§
Required Methods§
Sourcefn enumerate(&self, list: &mut Vec<Self::Device>) -> Result<(), Self::Error>
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
Sourcefn identifier() -> &'static str
fn identifier() -> &'static str
Unique name for representing the api type in log messages
Provided Methods§
Sourcefn needs_enumeration(&self) -> bool
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.
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.