[−][src]Struct rc_slice::RcSlice
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]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Deref for RcSlice<T>
[src]
impl<T> From<Rc<[T]>> for RcSlice<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,