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

Implementations on Foreign Types§

source§

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

source§

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

source§

fn accumulate(&mut self, acc: T)

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<'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<T> Accumulate<T> for usize

source§

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

source§

fn accumulate(&mut self, _acc: T)

source§

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

source§

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

source§

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

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 Accumulate<char> for String

source§

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

source§

fn accumulate(&mut self, acc: char)

source§

impl<T> Accumulate<T> for ()

source§

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

source§

fn accumulate(&mut self, _acc: T)

Implementors§