pub struct Segment<P> {
pub start: P,
pub end: P,
}Expand description
A bounded linear span between two endpoints.
A segment is stored by its endpoints rather than an origin/direction pair
with an interval, because endpoint identity is what topology and imported
data actually carry. The natural parameterisation is start + t * (end - start) over t in [0, 1]; keeping that implicit avoids inventing a
parameter range the source never stated.
Fields§
§start: PEndpoint at parameter zero.
end: PEndpoint at parameter one.
Trait Implementations§
impl<P> Copy for Segment<P>where
P: Copy,
impl<P> StructuralPartialEq for Segment<P>
Auto Trait Implementations§
impl<P> Freeze for Segment<P>where
P: Freeze,
impl<P> RefUnwindSafe for Segment<P>where
P: RefUnwindSafe,
impl<P> Send for Segment<P>where
P: Send,
impl<P> Sync for Segment<P>where
P: Sync,
impl<P> Unpin for Segment<P>where
P: Unpin,
impl<P> UnwindSafe for Segment<P>where
P: 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