#[non_exhaustive]pub enum PathCommand {
MoveTo(Point),
LineTo(Point),
QuadCurveTo {
control: Point,
end: Point,
},
CubicCurveTo {
c1: Point,
c2: Point,
end: Point,
},
ArcTo {
rx: f32,
ry: f32,
x_axis_rot: f32,
large_arc: bool,
sweep: bool,
end: Point,
},
Close,
}Expand description
A single path-construction command.
Marked #[non_exhaustive] so smooth-curve / Bezier-shorthand
variants can be added later without breaking match arms.
Note on ArcTo: SVG and PDF both accept elliptic-arc segments in
their path syntax (SVG A command, PDF via cubic approximation in
the writer). We keep the variant in the round-1 IR — converting an
arc to its spec-correct cubic-Bezier flattening is a pure function
of the arc parameters that downstream rasterizers / writers can do
independently.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MoveTo(Point)
LineTo(Point)
QuadCurveTo
CubicCurveTo
ArcTo
SVG A-style elliptic arc segment. x_axis_rot is in radians
(consistent with Transform2D::rotate); large_arc / sweep
match the SVG flag semantics.
Close
Trait Implementations§
Source§impl Clone for PathCommand
impl Clone for PathCommand
Source§fn clone(&self) -> PathCommand
fn clone(&self) -> PathCommand
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 PathCommand
impl Debug for PathCommand
Source§impl PartialEq for PathCommand
impl PartialEq for PathCommand
impl Copy for PathCommand
impl StructuralPartialEq for PathCommand
Auto Trait Implementations§
impl Freeze for PathCommand
impl RefUnwindSafe for PathCommand
impl Send for PathCommand
impl Sync for PathCommand
impl Unpin for PathCommand
impl UnsafeUnpin for PathCommand
impl UnwindSafe for PathCommand
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