Struct SplitInclusiveMut

#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct SplitInclusiveMut<'a, T: 'a, P>
where
    P: FnMut(&T) -> bool, { pub(in ::slice::iter) v: &'a mut [T], pub(in ::slice::iter) pred: P, pub(in ::slice::iter) finished: bool }

An iterator over the mutable subslices of the vector which are separated by elements that match pred. Unlike SplitMut, it contains the matched parts in the ends of the subslices.

This struct is created by the split_inclusive_mut method on slices.

Example

let mut v = [10, 40, 30, 20, 60, 50];
let iter = v.split_inclusive_mut(|num| *num % 3 == 0);

Fields

v: &'a mut [T]
pred: P
finished: bool

Implementations

impl<'a, T: 'a, P: FnMut(&T) -> bool> SplitInclusiveMut<'a, T, P>

fn new(slice: &'a mut [T], pred: P) -> Self

Trait Implementations

impl<'a, T, P> DoubleEndedIterator for SplitInclusiveMut<'a, T, P> where P: FnMut(&T) -> bool,

fn next_back(&mut self) -> Option<&'a mut [T]>

impl<'a, T, P> Iterator for SplitInclusiveMut<'a, T, P> where P: FnMut(&T) -> bool,

type Item = &'a mut [T];
fn next(&mut self) -> Option<&'a mut [T]>
fn size_hint(&self) -> (usize, Option<usize>)

impl<T, P> FusedIterator for SplitInclusiveMut<'_, T, P> where P: FnMut(&T) -> bool,

impl<T: Debug, P> Debug for SplitInclusiveMut<'_, T, P> where P: FnMut(&T) -> bool,

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<'a, T, P> !UnwindSafe for SplitInclusiveMut<'a, T, P>

impl<'a, T, P> Freeze for SplitInclusiveMut<'a, T, P> where &'a mut [T]: Freeze, P: Freeze,

impl<'a, T, P> RefUnwindSafe for SplitInclusiveMut<'a, T, P> where &'a mut [T]: RefUnwindSafe, P: RefUnwindSafe,

impl<'a, T, P> Send for SplitInclusiveMut<'a, T, P> where &'a mut [T]: Send, P: Send,

impl<'a, T, P> Sync for SplitInclusiveMut<'a, T, P> where &'a mut [T]: Sync, P: Sync,

impl<'a, T, P> Unpin for SplitInclusiveMut<'a, T, P> where &'a mut [T]: Unpin, P: Unpin,

impl<'a, T, P> UnsafeUnpin for SplitInclusiveMut<'a, T, P> where &'a mut [T]: UnsafeUnpin, P: UnsafeUnpin,

Blanket Implementations

impl<I> IntoIterator for SplitInclusiveMut<'a, T, P> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

impl<T> Any for SplitInclusiveMut<'a, T, P> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for SplitInclusiveMut<'a, T, P> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for SplitInclusiveMut<'a, T, P> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for SplitInclusiveMut<'a, T, P>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for SplitInclusiveMut<'a, T, P> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for SplitInclusiveMut<'a, T, P>

impl<T, U> Into<U> for SplitInclusiveMut<'a, T, P> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for SplitInclusiveMut<'a, T, P> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for SplitInclusiveMut<'a, T, P> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>