Skip to main content

Renderer

Trait Renderer 

Source
pub trait Renderer<Code: ModuleSource + ?Sized> {
    type Output;
    type Error;

    // Required method
    fn render(&self, code: &Code) -> Result<Self::Output, Self::Error>;
}
Expand description

Renders a module-grid source into a concrete output type.

The Code parameter is usually a type implementing ModuleSource, such as the facade crate’s QrCode, but may also be a third-party borrowed view.

Required Associated Types§

Source

type Output

The rendered output.

Source

type Error

The rendering error type.

Required Methods§

Source

fn render(&self, code: &Code) -> Result<Self::Output, Self::Error>

Renders code.

§Errors

Returns Self::Error when rendering fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§