Trait winnow::stream::Accumulate

source ·
pub trait Accumulate<T>: Sized {
    // Required methods
    fn initial(capacity: Option<usize>) -> Self;
    fn accumulate(&mut self, acc: T);
}
Expand description

Abstracts something which can extend an Extend. Used to build modified input slices in escaped_transform

Required Methods§

source

fn initial(capacity: Option<usize>) -> Self

Create a new Extend of the correct type

source

fn accumulate(&mut self, acc: T)

Accumulate the input into an accumulator

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Accumulate<char> for String

source§

fn initial(capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, acc: char)

source§

impl<'i> Accumulate<&'i str> for String

source§

fn initial(capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, acc: &'i str)

source§

impl<'i, T: Clone> Accumulate<&'i [T]> for Vec<T>

source§

fn initial(capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, acc: &'i [T])

source§

impl<K> Accumulate<K> for BTreeSet<K>
where K: Ord,

source§

fn initial(_capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, key: K)

source§

impl<K, S> Accumulate<K> for HashSet<K, S>
where K: Eq + Hash, S: BuildHasher + Default,

source§

fn initial(capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, key: K)

source§

impl<K, V> Accumulate<(K, V)> for BTreeMap<K, V>
where K: Ord,

source§

fn initial(_capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, (key, value): (K, V))

source§

impl<K, V, S> Accumulate<(K, V)> for HashMap<K, V, S>
where K: Eq + Hash, S: BuildHasher + Default,

source§

fn initial(capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, (key, value): (K, V))

source§

impl<T> Accumulate<T> for ()

source§

fn initial(_capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, _acc: T)

source§

impl<T> Accumulate<T> for usize

source§

fn initial(_capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, _acc: T)

source§

impl<T> Accumulate<T> for Vec<T>

source§

fn initial(capacity: Option<usize>) -> Self

source§

fn accumulate(&mut self, acc: T)

Implementors§