Module indexing::pointer [] [src]

Pointer-based inbounds intervals and element references.

These are safe abstractions built upon raw pointers instead of indices. Which choice of Range, PRange or PSlice generates best code depends on the algorithm.

All element read/write access still goes through a nominal borrow of the container with the correct brand; this ensures the usual & vs &mut borrowing rules apply.

The pointer type PIndex has a proof parameter just like the range; this allows us to represent the one-past-the-end pointer.

Structs

PIndex

PIndex is a pointer to a location.

PRange

PRange is a pointer-based valid range with start and end pointer representation.

PRangeIter

Pointer range iterator, yields PIndex<'id, T>.

PSlice

PSlice is a pointer-based valid range with start pointer and length representation.

Traits

ContainerRef

A reference to a Container<'id, _, _>.

PointerRange

Unsafe because: Must only be implemented by a range branded by 'id.

Functions

zip

Pointer-based zip (lock step iteration) of two ranges from two containers.