pub enum SvgShape {
Rect {
x: f64,
y: f64,
width: f64,
height: f64,
fill: Option<String>,
stroke: Option<String>,
stroke_width: Option<f64>,
rx: Option<f64>,
ry: Option<f64>,
},
Circle {
cx: f64,
cy: f64,
r: f64,
fill: Option<String>,
stroke: Option<String>,
stroke_width: Option<f64>,
},
Ellipse {
cx: f64,
cy: f64,
rx: f64,
ry: f64,
fill: Option<String>,
stroke: Option<String>,
stroke_width: Option<f64>,
},
Line {
x1: f64,
y1: f64,
x2: f64,
y2: f64,
stroke: Option<String>,
stroke_width: Option<f64>,
},
Polyline {
points: Vec<(f64, f64)>,
stroke: Option<String>,
stroke_width: Option<f64>,
fill: Option<String>,
},
Polygon {
points: Vec<(f64, f64)>,
fill: Option<String>,
stroke: Option<String>,
stroke_width: Option<f64>,
},
Path {
d: String,
fill: Option<String>,
stroke: Option<String>,
stroke_width: Option<f64>,
},
Text {
x: f64,
y: f64,
content: String,
font_size: Option<f64>,
fill: Option<String>,
font_family: Option<String>,
},
Group {
id: Option<String>,
children: Vec<SvgShape>,
},
}Expand description
SVG shape primitives
Variants§
Rect
Rectangle
Fields
Circle
Circle
Ellipse
Ellipse
Fields
Line
Line
Polyline
Polyline (open path)
Fields
Polygon
Polygon (closed path)
Fields
Path
Path with SVG path data
Text
Text
Fields
Group
Group of shapes
Implementations§
Source§impl SvgShape
impl SvgShape
Sourcepub fn with_stroke(self, stroke: impl Into<String>) -> Self
pub fn with_stroke(self, stroke: impl Into<String>) -> Self
Set stroke color
Sourcepub fn with_stroke_width(self, width: f64) -> Self
pub fn with_stroke_width(self, width: f64) -> Self
Set stroke width
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SvgShape
impl RefUnwindSafe for SvgShape
impl Send for SvgShape
impl Sync for SvgShape
impl Unpin for SvgShape
impl UnsafeUnpin for SvgShape
impl UnwindSafe for SvgShape
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more