Enum PathEl
pub enum PathEl {
MoveTo(Point),
LineTo(Point),
QuadTo(Point, Point),
CurveTo(Point, Point, Point),
ClosePath,
}Expand description
The element of a Bézier path.
A valid path has MoveTo at the beginning of each subpath.
Variants§
MoveTo(Point)
Move directly to the point without drawing anything, starting a new subpath.
LineTo(Point)
Draw a line from the current location to the point.
QuadTo(Point, Point)
Draw a quadratic Bézier using the current location and the two points.
The first point is the Bézier’s control point, the second is its end point.
CurveTo(Point, Point, Point)
Draw a cubic Bézier using the current location and the three points.
The first two points are the Bézier’s control points, the last point is its end point.
ClosePath
Close off the path.
Implementations§
Trait Implementations§
§impl Extend<PathEl> for BezPath
impl Extend<PathEl> for BezPath
§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = PathEl>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = PathEl>,
Add the items from the iterator to this path.
Note that if you’re attempting to make a continuous path, you will generally
want to ensure that the iterator does not contain any MoveTo
or ClosePath elements.
Note especially that many (open) shapes will start with a MoveTo if
you use their path_elements function.
Some shapes have alternatives for this use case, such as Arc::append_iter.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)§impl FromIterator<PathEl> for BezPath
impl FromIterator<PathEl> for BezPath
§impl Mul<PathEl> for TranslateScale
impl Mul<PathEl> for TranslateScale
impl Copy for PathEl
impl StructuralPartialEq for PathEl
Auto Trait Implementations§
impl Freeze for PathEl
impl RefUnwindSafe for PathEl
impl Send for PathEl
impl Sync for PathEl
impl Unpin for PathEl
impl UnsafeUnpin for PathEl
impl UnwindSafe for PathEl
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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