[][src]Struct rc_slice::RcSlice

pub struct RcSlice<T> { /* fields omitted */ }

A read-only view into an underlying reference-counted slice.

The associated functions provided for this type do not take a receiver to avoid conflicting with (present or future) methods on [T], since RcSlice<T>: Deref<Target = [T]>.

Implementations

impl<T> RcSlice<T>[src]

pub fn bounds(it: &Self) -> (usize, usize)[src]

Returns the starting and ending indices of the view it within the underlying slice.

pub fn advance(it: &mut Self, incr: usize) -> Option<&[T]>[src]

Increases the starting index of it by incr places, and returns a reference to the elements cut off by this operation.

Returns None and leaves it unchanged if this operation would make the starting index greater than the ending index.

pub fn retract(it: &mut Self, decr: usize) -> Option<&[T]>[src]

Decreases the ending index of it by decr places, and returns a reference to the elements cut off by this operation.

Returns None and leaves it unchanged if this operation would make the ending index less than the starting index.

pub fn split_off_before(it: &mut Self, index: usize) -> Option<Self>[src]

Mutates the view it to point to only the first index elements of the underlying slice, and returns a new view of the remaining elements.

Returns None and leaves it unchanged if the underlying slice has fewer than index elements.

pub fn split_off_after(it: &mut Self, index: usize) -> Option<Self>[src]

Returns a new view of the first index elements of the underlying slice, and mutates it to point to only the remaining elements.

Returns None and leaves it unchanged if the underlying slice has fewer than index elements.

Trait Implementations

impl<T> AsRef<[T]> for RcSlice<T>[src]

impl<T> Clone for RcSlice<T>[src]

impl<T> Deref for RcSlice<T>[src]

type Target = [T]

The resulting type after dereferencing.

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

Auto Trait Implementations

impl<T> !Send for RcSlice<T>

impl<T> !Sync for RcSlice<T>

impl<T> Unpin for RcSlice<T>

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<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.