pub struct LineSegment { /* private fields */ }Expand description
A straight line between two different points
Implementations§
Source§impl LineSegment
impl LineSegment
pub fn try_new( start: ICoord, end: ICoord, ) -> Result<Self, StartAndEndAreTheSame>
Sourcepub fn new(start: ICoord, end: ICoord) -> Self
pub fn new(start: ICoord, end: ICoord) -> Self
Creates a new LineSegment panicking if start and end are the same
pub fn start(&self) -> ICoord
pub fn end(&self) -> ICoord
pub fn delta(&self) -> ICoord
pub fn num_steps(&self) -> u32
pub fn num_cardinal_steps(&self) -> u32
pub fn reverse(&self) -> Self
pub fn infinite_iter(&self) -> InfiniteIter ⓘ
pub fn infinite_cardinal_iter(&self) -> InfiniteCardinalIter ⓘ
pub fn config_infinite_iter(&self, config: InfiniteConfig) -> InfiniteIter ⓘ
pub fn config_infinite_cardinal_iter( &self, config: InfiniteConfig, ) -> InfiniteCardinalIter ⓘ
Sourcepub fn iter(&self) -> Iter ⓘ
pub fn iter(&self) -> Iter ⓘ
Iterator over all coordinates allowing ordinal steps which begins on the start coordinate and ends with the end coordinate (inclusively)
Sourcepub fn cardinal_iter(&self) -> CardinalIter ⓘ
pub fn cardinal_iter(&self) -> CardinalIter ⓘ
Iterator over all coordinates allowing only cardinal steps which begins on the start coordinate and ends with the end coordinate (inclusively)
pub fn config_iter(&self, config: Config) -> Iter ⓘ
pub fn config_cardinal_iter(&self, config: Config) -> CardinalIter ⓘ
pub fn infinite_node_iter(&self) -> InfiniteNodeIter ⓘ
pub fn infinite_cardinal_node_iter(&self) -> InfiniteCardinalNodeIter ⓘ
pub fn config_infinite_node_iter( &self, config: InfiniteConfig, ) -> InfiniteNodeIter ⓘ
pub fn config_infinite_cardinal_node_iter( &self, config: InfiniteConfig, ) -> InfiniteCardinalNodeIter ⓘ
pub fn node_iter(&self) -> NodeIter ⓘ
pub fn cardinal_node_iter(&self) -> CardinalNodeIter ⓘ
pub fn config_node_iter(&self, config: Config) -> NodeIter ⓘ
pub fn config_cardinal_node_iter(&self, config: Config) -> CardinalNodeIter ⓘ
Trait Implementations§
Source§impl Clone for LineSegment
impl Clone for LineSegment
Source§fn clone(&self) -> LineSegment
fn clone(&self) -> LineSegment
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 LineSegment
impl Debug for LineSegment
Source§impl Hash for LineSegment
impl Hash for LineSegment
Source§impl Ord for LineSegment
impl Ord for LineSegment
Source§fn cmp(&self, other: &LineSegment) -> Ordering
fn cmp(&self, other: &LineSegment) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LineSegment
impl PartialEq for LineSegment
Source§impl PartialOrd for LineSegment
impl PartialOrd for LineSegment
impl Copy for LineSegment
impl Eq for LineSegment
impl StructuralPartialEq for LineSegment
Auto Trait Implementations§
impl Freeze for LineSegment
impl RefUnwindSafe for LineSegment
impl Send for LineSegment
impl Sync for LineSegment
impl Unpin for LineSegment
impl UnwindSafe for LineSegment
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