pub enum ElementType {
Path {
points: Vec<Point>,
stroke_width: f32,
color: String,
},
Rectangle {
x: f32,
y: f32,
width: f32,
height: f32,
fill: Option<String>,
stroke: Option<String>,
},
Ellipse {
cx: f32,
cy: f32,
rx: f32,
ry: f32,
fill: Option<String>,
stroke: Option<String>,
},
Text {
x: f32,
y: f32,
content: String,
font_size: f32,
color: String,
},
Image {
x: f32,
y: f32,
width: f32,
height: f32,
data_url: String,
},
}Expand description
Types of canvas elements.
Variants§
Path
Freehand path/stroke.
Fields
Rectangle
Rectangle shape.
Fields
Ellipse
Ellipse shape.
Fields
Text
Text element.
Fields
Image
Image element.
Trait Implementations§
Source§impl Clone for ElementType
impl Clone for ElementType
Source§fn clone(&self) -> ElementType
fn clone(&self) -> ElementType
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 moreSource§impl Debug for ElementType
impl Debug for ElementType
Source§impl<'de> Deserialize<'de> for ElementType
impl<'de> Deserialize<'de> for ElementType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ElementType
impl PartialEq for ElementType
Source§impl Serialize for ElementType
impl Serialize for ElementType
impl StructuralPartialEq for ElementType
Auto Trait Implementations§
impl Freeze for ElementType
impl RefUnwindSafe for ElementType
impl Send for ElementType
impl Sync for ElementType
impl Unpin for ElementType
impl UnsafeUnpin for ElementType
impl UnwindSafe for ElementType
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