pub trait PathCore {
// Required methods
fn current(&self) -> Point;
fn move_to_impl(&mut self, to: Point) -> &mut Self;
fn line_to_impl(&mut self, to: Point) -> &mut Self;
fn quadratic_to_impl(&mut self, c1: Point, to: Point) -> &mut Self;
fn cubic_to_impl(&mut self, c1: Point, c2: Point, to: Point) -> &mut Self;
fn close(&mut self) -> &mut Self;
// Provided methods
fn move_to(&mut self, to: impl Into<Point>) -> &mut Self { ... }
fn line_to(&mut self, to: impl Into<Point>) -> &mut Self { ... }
fn quadratic_to(
&mut self,
c1: impl Into<Point>,
to: impl Into<Point>,
) -> &mut Self { ... }
fn cubic_to(
&mut self,
c1: impl Into<Point>,
c2: impl Into<Point>,
to: impl Into<Point>,
) -> &mut Self { ... }
}Expand description
Core trait for building path objects in vector graphics.
Required Methods§
fn move_to_impl(&mut self, to: Point) -> &mut Self
fn line_to_impl(&mut self, to: Point) -> &mut Self
fn quadratic_to_impl(&mut self, c1: Point, to: Point) -> &mut Self
fn cubic_to_impl(&mut self, c1: Point, c2: Point, to: Point) -> &mut Self
Provided Methods§
Sourcefn move_to(&mut self, to: impl Into<Point>) -> &mut Self
fn move_to(&mut self, to: impl Into<Point>) -> &mut Self
Moves the current position to the specified point.
Sourcefn line_to(&mut self, to: impl Into<Point>) -> &mut Self
fn line_to(&mut self, to: impl Into<Point>) -> &mut Self
Draws a straight line from the current position to the specified point.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl PathCore for &mut Vec<PathCmd>
Implementation of PathCore for mutable reference to Vec
Allows building paths by appending PathCmd elements to a vector.
impl PathCore for &mut Vec<PathCmd>
Implementation of PathCore for mutable reference to Vec
fn current(&self) -> Point
fn move_to_impl(&mut self, to: Point) -> &mut Self
fn line_to_impl(&mut self, to: Point) -> &mut Self
fn quadratic_to_impl(&mut self, c1: Point, to: Point) -> &mut Self
fn cubic_to_impl(&mut self, c1: Point, c2: Point, to: Point) -> &mut Self
fn close(&mut self) -> &mut Self
Source§impl<'a, 'b> PathCore for (&'a mut Vec<PathVerb>, &'b mut Vec<Point>)
Implementation of PathCore for a tuple of verb and point vectors
Separates path verbs from their associated points for efficient storage.
impl<'a, 'b> PathCore for (&'a mut Vec<PathVerb>, &'b mut Vec<Point>)
Implementation of PathCore for a tuple of verb and point vectors Separates path verbs from their associated points for efficient storage.