pub trait Bind<Target>: Unbind {
// Required method
fn bind(&mut self, target: Target) -> Result<(), <Self as Renderer>::Error>;
// Provided method
fn supported_formats(&self) -> Option<HashSet<Format>> { ... }
}
Expand description
Abstraction for Renderers, that can render into different targets
Required Methods§
Sourcefn bind(&mut self, target: Target) -> Result<(), <Self as Renderer>::Error>
fn bind(&mut self, target: Target) -> Result<(), <Self as Renderer>::Error>
Bind a given rendering target, which will contain the rendering results until unbind
is called.
Binding to target, while another one is already bound, is rendering defined. Some renderers might happily replace the current target, while other might drop the call or throw an error.
Provided Methods§
Sourcefn supported_formats(&self) -> Option<HashSet<Format>>
fn supported_formats(&self) -> Option<HashSet<Format>>
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.