pub struct LineOrPoint<T: GeoNum> { /* private fields */ }
Expand description

Either a line segment or a point.

The coordinates are ordered (see SweepPoint) and a line segment must have distinct points (use the Point variant if the coordinates are the equal).

Implementations§

Checks if the variant is a line.

Return a Line representation of self.

Intersect a line with self and return a point, a overlapping segment or None.

The other argument must be a line variant (debug builds will panic otherwise).

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Scalar used the coordinates.
The geometry associated with this type. Use a Line with the start and end coordinates to represent a point. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.

Convert from a Coord

Converts to this type from the input type.

Convert from a Line ensuring end point ordering.

Converts to this type from the input type.
Converts to this type from the input type.

Equality based on ordering defined for segments as per algorithm.

This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Ordering defined for segments as per algorithm.

Requires the following conditions:

  1. If comparing two lines, both the left ends must be strictly smaller than both right ends.

  2. A point is treated as a infinitesimal small vertical segment centered at its coordinates.

This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.