pub enum DrawCommand {
None,
Rect {
background: Option<Color>,
border_width: Edges,
border_color: EdgeValues<Color>,
border_radius: CornerValues,
opacity: f64,
},
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,
},
}Expand description
What to actually draw for this element.
Variants§
None
Nothing to draw (just a layout container).
Rect
Draw a rectangle (background, border).
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).
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 · 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