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.


The range offset

The range length

The data described within the range.


impl Range

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>

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>

impl<T: Clone> Clone for Range<T>

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq for Range<T>

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>

impl<T: Hash> Hash for Range<T>

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>

Formats the value using the given formatter.

impl<T> From<(Range, T)> for Range<T>

Performs the conversion.