Skip to main content

RenderTemplate

Trait RenderTemplate 

Source
pub trait RenderTemplate {
    // Required methods
    fn dark_color(&self) -> &str;
    fn light_color(&self) -> &str;
    fn module_size(&self) -> Option<(u32, u32)>;
    fn quiet_zone(&self) -> bool;
}
Expand description

Styling data that can be applied to a Renderer with Renderer::template.

The facade crate implements this for its QrTemplate, while downstream crates can provide their own lightweight template types without depending on the facade.

Required Methods§

Source

fn dark_color(&self) -> &str

Dark module color as a CSS hex string.

Source

fn light_color(&self) -> &str

Light module color as a CSS hex string.

Source

fn module_size(&self) -> Option<(u32, u32)>

Optional module dimensions (width, height).

Source

fn quiet_zone(&self) -> bool

Whether to include the quiet zone.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§