Struct a_range::Range[][src]

pub struct Range<Idx, Direction> { /* fields omitted */ }

A range

This is basically a start, and end, an a direction.

The index type can be any type, but to get a useful range, you need to supply something that implements some common traits, like Clone, and PartialEq; but also One (the identity element used) as well as AddAssign and SubAssign (to work increment/decrement the index).

Methods

impl<Idx> Range<Idx, Upwards> where
    Idx: Clone + PartialEq + One + AddAssign + SubAssign
[src]

Range counting up

Collect range into a container

Works for any container type that implements FromIterator.

Turn range into a Vec

impl<Idx> Range<Idx, Downwards> where
    Idx: Clone + PartialEq + One + AddAssign + SubAssign
[src]

Range counting down

Collect range into a container

Works for any container type that implements FromIterator.

Turn range into a Vec

Trait Implementations

impl<Idx: Clone, Direction: Clone> Clone for Range<Idx, Direction>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<Idx: Debug, Direction: Debug> Debug for Range<Idx, Direction>
[src]

Formats the value using the given formatter. Read more

impl<Idx: Hash, Direction: Hash> Hash for Range<Idx, Direction>
[src]

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

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

impl<Idx: PartialEq, Direction: PartialEq> PartialEq for Range<Idx, Direction>
[src]

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

This method tests for !=.

impl<Idx: Eq, Direction: Eq> Eq for Range<Idx, Direction>
[src]

impl<Idx: PartialOrd, Direction: PartialOrd> PartialOrd for Range<Idx, Direction>
[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<Idx> IntoIterator for Range<Idx, Upwards> where
    Idx: Clone + PartialEq + One + AddAssign + SubAssign
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<Idx> IntoIterator for Range<Idx, Downwards> where
    Idx: Clone + PartialEq + One + AddAssign + SubAssign
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

impl<Idx, Direction> Send for Range<Idx, Direction> where
    Direction: Send,
    Idx: Send

impl<Idx, Direction> Sync for Range<Idx, Direction> where
    Direction: Sync,
    Idx: Sync