pub trait SplitAtWhile {
    type Item;

    // Required method
    fn split_at_while<F>(&self, f: F) -> (&Self, &Self)
       where F: FnMut(&Self::Item) -> bool;
}

Required Associated Types§

Required Methods§

source

fn split_at_while<F>(&self, f: F) -> (&Self, &Self)where F: FnMut(&Self::Item) -> bool,

Splits a slice at the first point after which f returns false. Usually used to segment input according to character categories.

e.g. 1. part while f(x) == true, then 2. part

Implementations on Foreign Types§

source§

impl<T> SplitAtWhile for [T]

§

type Item = T

source§

fn split_at_while<F>(&self, f: F) -> (&Self, &Self)where F: FnMut(&T) -> bool,

source§

impl SplitAtWhile for str

§

type Item = char

source§

fn split_at_while<F>(&self, f: F) -> (&Self, &Self)where F: FnMut(&char) -> bool,

Implementors§