Trait slice_group_by::StrGroupBy
source · [−]pub trait StrGroupBy {
fn linear_group_by_key<F, K>(&self, func: F) -> LinearStrGroupByKey<'_, F>ⓘNotable traits for LinearStrGroupByKey<'a, F>impl<'a, F, K> Iterator for LinearStrGroupByKey<'a, F> where
F: FnMut(char) -> K,
K: PartialEq, type Item = &'a str;
where
F: FnMut(char) -> K,
K: PartialEq;
fn linear_group_by<P>(&self, predicate: P) -> LinearStrGroupBy<'_, P>ⓘNotable traits for LinearStrGroupBy<'a, P>impl<'a, P> Iterator for LinearStrGroupBy<'a, P> where
P: FnMut(char, char) -> bool, type Item = &'a str;
where
P: FnMut(char, char) -> bool;
fn linear_group(&self) -> LinearStrGroup<'_>ⓘNotable traits for LinearStrGroup<'a>impl<'a> Iterator for LinearStrGroup<'a> type Item = &'a str;
;
}
Expand description
A convenient trait to construct an iterator returning non-overlapping str
slices
defined by a predicate.
Required methods
fn linear_group_by_key<F, K>(&self, func: F) -> LinearStrGroupByKey<'_, F>ⓘNotable traits for LinearStrGroupByKey<'a, F>impl<'a, F, K> Iterator for LinearStrGroupByKey<'a, F> where
F: FnMut(char) -> K,
K: PartialEq, type Item = &'a str;
where
F: FnMut(char) -> K,
K: PartialEq,
fn linear_group_by_key<F, K>(&self, func: F) -> LinearStrGroupByKey<'_, F>ⓘNotable traits for LinearStrGroupByKey<'a, F>impl<'a, F, K> Iterator for LinearStrGroupByKey<'a, F> where
F: FnMut(char) -> K,
K: PartialEq, type Item = &'a str;
where
F: FnMut(char) -> K,
K: PartialEq,
F: FnMut(char) -> K,
K: PartialEq, type Item = &'a str;
Returns an iterator on str
groups based that will use the given function
to generate keys and determine groups based on them. It uses linear search
to iterate over groups.
fn linear_group_by<P>(&self, predicate: P) -> LinearStrGroupBy<'_, P>ⓘNotable traits for LinearStrGroupBy<'a, P>impl<'a, P> Iterator for LinearStrGroupBy<'a, P> where
P: FnMut(char, char) -> bool, type Item = &'a str;
where
P: FnMut(char, char) -> bool,
fn linear_group_by<P>(&self, predicate: P) -> LinearStrGroupBy<'_, P>ⓘNotable traits for LinearStrGroupBy<'a, P>impl<'a, P> Iterator for LinearStrGroupBy<'a, P> where
P: FnMut(char, char) -> bool, type Item = &'a str;
where
P: FnMut(char, char) -> bool,
P: FnMut(char, char) -> bool, type Item = &'a str;
Returns an iterator on str
groups using the linear search method.
fn linear_group(&self) -> LinearStrGroup<'_>ⓘNotable traits for LinearStrGroup<'a>impl<'a> Iterator for LinearStrGroup<'a> type Item = &'a str;
fn linear_group(&self) -> LinearStrGroup<'_>ⓘNotable traits for LinearStrGroup<'a>impl<'a> Iterator for LinearStrGroup<'a> type Item = &'a str;
Returns an iterator on str
groups based on the PartialEq::eq
method of char
,
it uses linear search to iterate over groups.
Implementations on Foreign Types
sourceimpl StrGroupBy for str
impl StrGroupBy for str
fn linear_group_by_key<F, K>(&self, func: F) -> LinearStrGroupByKey<'_, F>ⓘNotable traits for LinearStrGroupByKey<'a, F>impl<'a, F, K> Iterator for LinearStrGroupByKey<'a, F> where
F: FnMut(char) -> K,
K: PartialEq, type Item = &'a str;
where
F: FnMut(char) -> K,
K: PartialEq,
F: FnMut(char) -> K,
K: PartialEq, type Item = &'a str;
fn linear_group_by<P>(&self, predicate: P) -> LinearStrGroupBy<'_, P>ⓘNotable traits for LinearStrGroupBy<'a, P>impl<'a, P> Iterator for LinearStrGroupBy<'a, P> where
P: FnMut(char, char) -> bool, type Item = &'a str;
where
P: FnMut(char, char) -> bool,
P: FnMut(char, char) -> bool, type Item = &'a str;