pub trait Bind<Target>: Renderer {
// Required method
fn bind<'a>(
&mut self,
target: &'a mut Target,
) -> Result<Self::Framebuffer<'a>, Self::Error>;
// Provided method
fn supported_formats(&self) -> Option<FormatSet> { ... }
}Expand description
Abstraction for Renderers, that can render into different targets
Required Methods§
Sourcefn bind<'a>(
&mut self,
target: &'a mut Target,
) -> Result<Self::Framebuffer<'a>, Self::Error>
fn bind<'a>( &mut self, target: &'a mut Target, ) -> Result<Self::Framebuffer<'a>, Self::Error>
Initialize a framebuffer with a given rendering target.
This function may error, if:
- The specific given target handle is incompatible with the underlying rendering api
Note: Some renderers might only be able to determine if a handle is compatible
during a Renderer::render call with the resulting Framebuffer.
Provided Methods§
Sourcefn supported_formats(&self) -> Option<FormatSet>
fn supported_formats(&self) -> Option<FormatSet>
Supported pixel formats for given targets, if applicable.
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§
impl Bind<Dmabuf> for GlesRenderer
Available on crate feature
renderer_gl only.impl Bind<Dmabuf> for PixmanRenderer
Available on crate feature
renderer_pixman only.impl Bind<EGLSurface> for GlesRenderer
Available on crate feature
renderer_gl only.impl Bind<GlesRenderbuffer> for GlesRenderer
Available on crate feature
renderer_gl only.impl Bind<GlesTexture> for GlesRenderer
Available on crate feature
renderer_gl only.impl Bind<Image<'static, 'static>> for PixmanRenderer
Available on crate feature
renderer_pixman only.impl<R, T: GraphicsApi, Target> Bind<Target> for MultiRenderer<'_, '_, R, T>where
<T::Device as ApiDevice>::Renderer: Bind<Target> + ImportDma + ImportMem,
<R::Device as ApiDevice>::Renderer: Bind<Target> + Bind<Dmabuf> + ExportMem + ImportDma + ImportMem,
R: 'static + GraphicsApi,
R::Error: 'static,
T::Error: 'static,
<<R::Device as ApiDevice>::Renderer as RendererSuper>::TextureId: Clone + Send,
<<R::Device as ApiDevice>::Renderer as RendererSuper>::Error: 'static,
<<T::Device as ApiDevice>::Renderer as RendererSuper>::Error: 'static,
Available on crate feature
renderer_multi only.impl<T> Bind<T> for GlowRendererwhere
GlesRenderer: Bind<T>,
Available on crate feature
renderer_glow only.