Struct indexing::Container [] [src]

pub struct Container<'id, Array> { /* fields omitted */ }

A branded container, that allows access only to indices and ranges with the exact same brand in the 'id parameter.

Methods

impl<'id, Array, T> Container<'id, Array> where Array: Buffer<Target=[T]>
[src]

Return the range [0, 0)

Return the full range of the Container.

Split in two ranges, where the first includes the index and the second starts with the following index.

Split around the Range r: Return ranges corresponding to 0..r.start and r.end...

So that input r and return values (s, t) cover the whole container in the order s, r, t.

Return the range before (not including) the index itself

Return the range after (not including) the index itself

Increment index, if doing so would still be in bounds.

Return true if the index was incremented.

Increment index, if doing so would still be in bounds.

Return true if the index was incremented.

Increment r, clamping to the end of the Container.

Decrement index, if doing so would still be in bounds.

Return true if the index was decremented.

Examine the elements after index in order from lower indices towards higher. While the closure returns true, continue scan and include the scanned element in the range.

Result always includes index in the range

Examine the elements before index in order from higher indices towards lower. While the closure returns true, continue scan and include the scanned element in the range.

Result always includes index in the range.

Examine the elements range in order from lower indices towards higher. While the closure returns true, continue scan and include the scanned element in the range.

Swap elements at i and j (they may be equal).

Rotate elements in the range r by one step to the right (towards higher indices)

Rotate elements in the range r by one step to the left (towards lower indices)

Index by two nonoverlapping ranges, where r is before s.

Zip by raw pointer (will be indentical if ranges have same starting point)

Trait Implementations

impl<'id, Array> Debug for Container<'id, Array> where Array: Debug
[src]

Formats the value using the given formatter.

impl<'id, Array> Clone for Container<'id, Array> where Array: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'id, T, Array> Index<Index<'id>> for Container<'id, Array> where Array: Buffer<Target=[T]>
[src]

&self[i] where i is an Index<'id>.

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'id, T, Array> IndexMut<Index<'id>> for Container<'id, Array> where Array: BufferMut<Target=[T]>
[src]

&mut self[i] where i is an Index<'id>.

The method for the mutable indexing (container[index]) operation

impl<'id, T, Array, P> Index<Range<'id, P>> for Container<'id, Array> where Array: Buffer<Target=[T]>
[src]

&self[r] where r is a Range<'id>.

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'id, T, Array, P> IndexMut<Range<'id, P>> for Container<'id, Array> where Array: BufferMut<Target=[T]>
[src]

&mut self[r] where r is a Range<'id>.

The method for the mutable indexing (container[index]) operation

impl<'id, T, Array> Index<RangeFrom<Index<'id>>> for Container<'id, Array> where Array: Buffer<Target=[T]>
[src]

&self[i..] where i is an Index<'id>.

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'id, T, Array> IndexMut<RangeFrom<Index<'id>>> for Container<'id, Array> where Array: BufferMut<Target=[T]>
[src]

&mut self[i..] where i is an Index<'id>.

The method for the mutable indexing (container[index]) operation

impl<'id, T, Array> Index<RangeTo<Index<'id>>> for Container<'id, Array> where Array: Buffer<Target=[T]>
[src]

&self[..i] where i is an Index<'id>.

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'id, T, Array> IndexMut<RangeTo<Index<'id>>> for Container<'id, Array> where Array: BufferMut<Target=[T]>
[src]

&mut self[..i] where i is an Index<'id>.

The method for the mutable indexing (container[index]) operation

impl<'id, T, Array> Index<RangeFull> for Container<'id, Array> where Array: Buffer<Target=[T]>
[src]

&self[..]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'id, T, Array> IndexMut<RangeFull> for Container<'id, Array> where Array: BufferMut<Target=[T]>
[src]

&mut self[..]

The method for the mutable indexing (container[index]) operation

impl<'id, 'a, T> Index<PIndex<'id, T>> for Container<'id, &'a mut [T]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'id, T, Array> Index<RangeTo<PIndex<'id, T>>> for Container<'id, Array> where Array: Buffer<Target=[T]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation