[][src]Struct odds::slice::iter::SliceCopyIter

pub struct SliceCopyIter<'a, T: 'a> { /* fields omitted */ }

Slice (contiguous data) iterator.

Iterator element type is T (by value). This iterator exists mainly to have the constructor from a pair of raw pointers available, which the libcore slice iterator does not allow.

Implementation note: Aliasing/optimization issues disappear if we use non-pointer iterator element type, so we use T. (The libcore slice iterator has assume and other tools available to combat it).

T must not be a zero sized type.

Methods

impl<'a, T> SliceCopyIter<'a, T> where
    T: Copy
[src]

pub unsafe fn new(ptr: *const T, end: *const T) -> Self[src]

Create a new slice copy iterator

Panics if T is a zero-sized type. That case is not supported.

pub fn into_raw(self) -> (*const T, *const T)[src]

Return the start, end pointer of the iterator

pub fn start(&self) -> *const T[src]

Return the start pointer

pub fn end(&self) -> *const T[src]

Return the end pointer

pub unsafe fn start_mut(&mut self) -> &mut *const T[src]

Return mutable reference to the start pointer

Unsafe because it is easy to violate memory safety by setting the pointer outside the data's valid range.

pub unsafe fn end_mut(&mut self) -> &mut *const T[src]

Return mutable reference to the start pointer

Unsafe because it is easy to violate memory safety by setting the pointer outside the data's valid range.

pub fn peek_next(&self) -> Option<Self::Item>[src]

Return the next iterator element, without stepping the iterator.

Trait Implementations

impl<'a, T> Clone for SliceCopyIter<'a, T>[src]

impl<'a, T> Copy for SliceCopyIter<'a, T>[src]

impl<'a, T: Debug + 'a> Debug for SliceCopyIter<'a, T>[src]

impl<'a, T> Default for SliceCopyIter<'a, T> where
    T: Copy
[src]

fn default() -> Self[src]

Create an empty SliceCopyIter.

impl<'a, T> DoubleEndedIterator for SliceCopyIter<'a, T> where
    T: Copy
[src]

impl<'a, T> ExactSizeIterator for SliceCopyIter<'a, T> where
    T: Copy
[src]

impl<'a, T> From<&'a [T]> for SliceCopyIter<'a, T> where
    T: Copy
[src]

impl<'a, T> Index<usize> for SliceCopyIter<'a, T> where
    T: Copy
[src]

type Output = T

The returned type after indexing.

impl<'a, T> Iterator for SliceCopyIter<'a, T> where
    T: Copy
[src]

type Item = T

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for SliceCopyIter<'a, T> where
    T: RefUnwindSafe

impl<'a, T> !Send for SliceCopyIter<'a, T>

impl<'a, T> !Sync for SliceCopyIter<'a, T>

impl<'a, T> Unpin for SliceCopyIter<'a, T>

impl<'a, T> UnwindSafe for SliceCopyIter<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.