pub struct Polyline<T> {
pub points: Vec<Point<T>>,
pub normalized: bool,
}Fields§
§points: Vec<Point<T>>§normalized: boolImplementations§
Source§impl<T> Polyline<T>
impl<T> Polyline<T>
pub fn from_points(points: impl Into<Vec<Point<T>>>) -> Self
pub fn empty() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, Point<T>>
pub fn points(&self) -> &[Point<T>]
Sourcepub fn prev_index(&self, i: usize) -> usize
pub fn prev_index(&self, i: usize) -> usize
Get index of previous vertex.
Sourcepub fn next_index(&self, i: usize) -> usize
pub fn next_index(&self, i: usize) -> usize
Get index of next vertex.
Source§impl<T: PartialOrd> Polyline<T>
impl<T: PartialOrd> Polyline<T>
Trait Implementations§
Source§impl<T, P> FromIterator<P> for Polyline<T>
impl<T, P> FromIterator<P> for Polyline<T>
Source§fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, T> IntoIterator for &'a Polyline<T>
impl<'a, T> IntoIterator for &'a Polyline<T>
Source§impl<T: Copy + PartialOrd> TryBoundingBox<T> for Polyline<T>
impl<T: Copy + PartialOrd> TryBoundingBox<T> for Polyline<T>
fn try_bounding_box(&self) -> Option<Rect<T>>
impl<T: Eq> Eq for Polyline<T>
impl<T> StructuralPartialEq for Polyline<T>
Auto Trait Implementations§
impl<T> Freeze for Polyline<T>
impl<T> RefUnwindSafe for Polyline<T>where
T: RefUnwindSafe,
impl<T> Send for Polyline<T>where
T: Send,
impl<T> Sync for Polyline<T>where
T: Sync,
impl<T> Unpin for Polyline<T>where
T: Unpin,
impl<T> UnwindSafe for Polyline<T>where
T: UnwindSafe,
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