Struct range::Range [] [src]

pub struct Range<T = ()> {
    pub offset: usize,
    pub length: usize,
    pub data: T,
}

A representation of a range

The type parameter is used to wrap data related to the range.

Fields

The range offset

The range length

The data described within the range.

Methods

impl Range
[src]

Creates a new Range

Wraps some data in the range.

Creates an empty range with an offset.

Shrinks range at both ends with n items.

Shrinks range at both ends with 1 item.

Intersects a range with another, where ends are excluded.

Intersects a range with another, where ends are included.

impl<T> Range<T>
[src]

Returns true if range is empty

Returns the next offset

Returns a range iterator.

Maps from some data to another.

Returns range information without the data.

Unwraps the data.

Decouples range and data.

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: 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: Eq> Eq for Range<T>
[src]

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: Debug> Debug for Range<T>
[src]

Formats the value using the given formatter.

impl<T> From<(Range, T)> for Range<T>
[src]

Performs the conversion.