Struct range_map::Range [] [src]

pub struct Range<T> {
    pub start: T,
    pub end: T,
}

A range of elements, including the endpoints.

Fields

Methods

impl<T: PrimInt> Range<T>
[src]

Creates a new range with the given start and endpoints (inclusive).

Panics

  • if start is strictly larger than end

Creates a new range containing everything.

Creates a new range containing a single thing.

Tests whether a given element belongs to this range.

Checks whether the intersections overlap.

Computes the intersection between two ranges. Returns none if the intersection is empty.

Returns the smallest range that covers self and other.

Trait Implementations

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Hash> Hash for Range<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: PartialEq> 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 !=.

impl<T: PartialOrd> PartialOrd for Range<T>
[src]

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

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

impl<T: Ord> Ord for Range<T>
[src]

This method returns an Ordering between self and other. Read more

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

Formats the value using the given formatter.

impl<T: PrimInt> PartialEq<T> 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 !=.

impl<T: PrimInt> PartialOrd<T> for Range<T>
[src]

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