Skip to main content

DrawUnit

Trait DrawUnit 

Source
pub trait DrawUnit<D: DrawTarget<Color = Rgb565>> {
    // Required methods
    fn can_handle(&self, task: &DrawTask<'_>) -> bool;
    fn execute(
        &mut self,
        task: &DrawTask<'_>,
        target: &mut D,
    ) -> Result<(), D::Error>;
}
Expand description

A pluggable hardware or software rendering unit.

Required Methods§

Source

fn can_handle(&self, task: &DrawTask<'_>) -> bool

Returns whether this draw unit can accelerate or handle the given task.

Source

fn execute( &mut self, task: &DrawTask<'_>, target: &mut D, ) -> Result<(), D::Error>

Executes the task on the target buffer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§