[−][src]Trait slice_ext::SplitBefore
SplitBefore trait returns an iterator splitting a slice before a predicate and including the matched item at the start of the next set (if found). For example:
use slice_ext::*; let a: Vec<u8> = vec![0, 1, 2]; let mut s = (&a[..]).split_before(|v| *v == 1 ); assert_eq!(s.next().unwrap(), &[0]); assert_eq!(s.next().unwrap(), &[1, 2]); assert_eq!(s.next().is_none(), true);
Required methods
ⓘImportant traits for SplitInc<'a, T, F>fn split_before(&self, predicate: P) -> SplitInc<'a, T, P>
ⓘImportant traits for SplitInc<'a, T, F>
Implementations on Foreign Types
impl<'a, T: 'a, P> SplitBefore<'a, T, P> for &'a [T] where
P: FnMut(&T) -> bool,
T: Debug, [src]
P: FnMut(&T) -> bool,
T: Debug,
ⓘImportant traits for SplitInc<'a, T, F>fn split_before(&self, predicate: P) -> SplitInc<'a, T, P>[src]
ⓘImportant traits for SplitInc<'a, T, F>