Skip to main content

Draw

Trait Draw 

Source
pub trait Draw: Send {
    // Required method
    fn draw(&self, canvas: &mut Canvas) -> Result<()>;
}
Expand description

Something that paints itself onto a Canvas. Send so a Content::Custom value never blocks a Pdf from crossing a thread boundary.

Required Methods§

Source

fn draw(&self, canvas: &mut Canvas) -> Result<()>

Paints this value’s content onto canvas.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Draw for Image

Source§

impl Draw for Paragraph

Tw (word spacing) is persistent text state that BeginText does not clear, so a stretch an earlier line left active must be reset before the first following line that does not itself stretch — not only once, at the very end.

Source§

impl Draw for Text