Bind

Trait Bind 

Source
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§

Source

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§

Source

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§

Source§

impl Bind<Dmabuf> for GlesRenderer

Available on crate feature renderer_gl only.
Source§

impl Bind<Dmabuf> for PixmanRenderer

Available on crate feature renderer_pixman only.
Source§

impl Bind<EGLSurface> for GlesRenderer

Available on crate feature renderer_gl only.
Source§

impl Bind<GlesRenderbuffer> for GlesRenderer

Available on crate feature renderer_gl only.
Source§

impl Bind<GlesTexture> for GlesRenderer

Available on crate feature renderer_gl only.
Source§

impl Bind<Image<'static, 'static>> for PixmanRenderer

Available on crate feature renderer_pixman only.
Source§

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.
Source§

impl<T> Bind<T> for GlowRenderer
where GlesRenderer: Bind<T>,

Available on crate feature renderer_glow only.