pub struct Path { /* private fields */ }Available on crate feature
geometry only.Expand description
An immutable set of points that may or may not be connected.
A single Path can represent different kinds of 2D shapes!
Implementations§
Source§impl Path
impl Path
Sourcepub fn line(from: Point, to: Point) -> Self
pub fn line(from: Point, to: Point) -> Self
Creates a new Path representing a line segment given its starting
and end points.
Sourcepub fn rectangle(top_left: Point, size: Size) -> Self
pub fn rectangle(top_left: Point, size: Size) -> Self
Creates a new Path representing a rectangle given its top-left
corner coordinate and its Size.
Sourcepub fn rounded_rectangle(top_left: Point, size: Size, radius: Radius) -> Self
pub fn rounded_rectangle(top_left: Point, size: Size, radius: Radius) -> Self
Creates a new Path representing a rounded rectangle given its top-left
corner coordinate, its [Size] and [border::Radius].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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