pub enum DrawCommand {
None,
Rect {
background: Option<Color>,
border_width: Edges,
border_color: EdgeValues<Color>,
border_radius: CornerValues,
opacity: f64,
box_shadow: Option<Box<BoxShadow>>,
background_gradient: Option<Box<Background>>,
},
Text {
lines: Vec<TextLine>,
color: Color,
text_decoration: TextDecoration,
opacity: f64,
},
Image {
image_data: LoadedImage,
},
ImagePlaceholder,
Svg {
commands: Vec<SvgCommand>,
width: f64,
height: f64,
clip: bool,
},
Barcode {
bars: Vec<u8>,
bar_width: f64,
height: f64,
color: Color,
},
QrCode {
modules: Vec<Vec<bool>>,
module_size: f64,
color: Color,
},
Chart {
primitives: Vec<ChartPrimitive>,
},
Watermark {
lines: Vec<TextLine>,
color: Color,
opacity: f64,
angle_rad: f64,
font_family: String,
},
FormField {
field_type: FormFieldType,
name: String,
},
}Expand description
What to actually draw for this element.
Variants§
None
Nothing to draw (just a layout container).
Rect
Draw a rectangle (background, border).
Fields
§
border_color: EdgeValues<Color>§
border_radius: CornerValues§
box_shadow: Option<Box<BoxShadow>>Optional drop shadow rendered before the background. Boxed
to keep the DrawCommand enum’s largest variant size down.
§
background_gradient: Option<Box<Background>>Optional gradient paint. When Some, takes precedence over
background (solid color). Boxed for the same enum-size
reason as box_shadow.
Text
Draw text.
Image
Draw an image.
Fields
§
image_data: LoadedImageImagePlaceholder
Draw a grey placeholder rectangle (fallback when image loading fails).
Svg
Draw SVG vector graphics.
Fields
§
commands: Vec<SvgCommand>Barcode
Draw a 1D barcode as filled rectangles.
QrCode
Draw a QR code as filled rectangles.
Chart
Draw a chart as a list of drawing primitives.
Fields
§
primitives: Vec<ChartPrimitive>Watermark
Draw a watermark (rotated text with opacity).
Fields
FormField
An interactive PDF form field (AcroForm widget annotation).
Trait Implementations§
Source§impl Clone for DrawCommand
impl Clone for DrawCommand
Source§fn clone(&self) -> DrawCommand
fn clone(&self) -> DrawCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DrawCommand
impl RefUnwindSafe for DrawCommand
impl Send for DrawCommand
impl Sync for DrawCommand
impl Unpin for DrawCommand
impl UnsafeUnpin for DrawCommand
impl UnwindSafe for DrawCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more