Struct indexing::pointer::PRange
[−]
[src]
pub struct PRange<'id, T, Proof = Unknown> { /* fields omitted */ }
PRange
is a pointer-based valid range with start and end pointer
representation.
Methods
impl<'id, T, P> PRange<'id, T, P>
[src]
fn len(self) -> usize
[src]
fn is_empty(self) -> bool
[src]
fn nonempty(&self) -> Result<PRange<'id, T, NonEmpty>, IndexingError>
[src]
Check if the range is empty. NonEmpty
ranges have extra methods.
fn split_in_half(self) -> (PRange<'id, T>, PRange<'id, T, P>)
[src]
Split the range in half, with the upper middle index landing in the
latter half. Proof of nonemptiness P
transfers to the latter half.
impl<'id, T, P> PRange<'id, T, P>
[src]
fn first(self) -> PIndex<'id, T, P>
[src]
fn upper_middle(self) -> PIndex<'id, T, P>
[src]
Return the middle index, rounding up on even
fn past_the_end(self) -> PIndex<'id, T, Unknown>
[src]
impl<'id, T> PRange<'id, T, NonEmpty>
[src]
fn last(self) -> PIndex<'id, T>
[src]
fn tail(self) -> PRange<'id, T>
[src]
fn init(self) -> PRange<'id, T>
[src]
fn advance(&mut self) -> bool
[src]
Increase the range's start, if the result is still a non-empty range.
Return true
if stepped successfully, false
if the range would be empty.
fn advance_back(&mut self) -> bool
[src]
Decrease the range's end, if the result is still a non-empty range.
Return true
if stepped successfully, false
if the range would be empty.
Trait Implementations
impl<'id, T, P> Provable for PRange<'id, T, P>
[src]
type Proof = P
type WithoutProof = PRange<'id, T, Unknown>
fn no_proof(self) -> Self::WithoutProof
[src]
Return a copy of self with the proof parameter set to Unknown
.
impl<'id, T: Debug, Proof: Debug> Debug for PRange<'id, T, Proof>
[src]
impl<'id, T, P> Copy for PRange<'id, T, P>
[src]
impl<'id, T, P> Clone for PRange<'id, T, P>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'id, T, P, Q> PartialEq<PRange<'id, T, Q>> for PRange<'id, T, P>
[src]
fn eq(&self, rhs: &PRange<'id, T, Q>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'id, T, P> Eq for PRange<'id, T, P>
[src]
impl<'id, T, P> PointerRange<'id> for PRange<'id, T, P>
[src]
type Item = T
fn first(self) -> PIndex<'id, T, Unknown>
[src]
fn end(self) -> PIndex<'id, T, Unknown>
[src]
fn len(self) -> usize
[src]
impl<'id, T, P> IntoIterator for PRange<'id, T, P>
[src]
type Item = PIndex<'id, T>
The type of the elements being iterated over.
type IntoIter = PRangeIter<'id, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more