Struct axgeom::Range[][src]

#[must_use]
pub struct Range<T: Copy> { pub left: T, pub right: T, }

A 1d range. Internally represented as start and end. (not start and length) This means that subdivision does not result in any floating point calculations. The left value be <= the right value. There is no protection against "degenerate" Ranges where left>right.

Fields

Methods

impl<T: Copy + PartialOrd> Range<T>
[src]

Returns true if the point is inside of the range or on top of. True if pos>=self.left&&pos<=self.right

impl<T: Copy + Sub<Output = T>> Range<T>
[src]

impl<T: Copy + Sub<Output = T> + Add<Output = T>> Range<T>
[src]

impl<T: Copy + Ord> Range<T>
[src]

If the pos is to the left of the range, return less. If the pos is to the right of the range, return greater. If the pos intersects with the range, return equal.

Returns true if self contains the specified range.

Creates a range that represents the intersection range.

Returns true if two ranges intersect.

Trait Implementations

impl<T: Copy + Copy> Copy for Range<T>
[src]

impl<T: Clone + Copy> Clone for Range<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug + Copy> Debug for Range<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Eq + Copy> Eq for Range<T>
[src]

impl<T: PartialEq + Copy> PartialEq for Range<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl<T> Send for Range<T> where
    T: Send

impl<T> Sync for Range<T> where
    T: Sync