Trait len_trait::index::SplitAt
[−]
[src]
pub trait SplitAt<Idx>: IndexRanges<Idx> { fn split_at(&self, index: Idx) -> (&Self::Output, &Self::Output); }
Trait for collections which can be split into two pieces at a given index.
Splitting a collection must take a constant amount of time and space.
Required Methods
fn split_at(&self, index: Idx) -> (&Self::Output, &Self::Output)
Splits the collection into two pieces at the given index.
Panics
Panics if index
is invalid according to the collection.
Implementors
impl<T> SplitAt<usize> for [T]
impl SplitAt<usize> for str