winnow::stream

Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§