devela::_dep::winnow::stream

Trait Accumulate

pub trait Accumulate<T>: Sized {
    // Required methods
    fn initial(capacity: Option<usize>) -> Self;
    fn accumulate(&mut self, acc: T);
}
Available on crate feature dep_winnow only.
Expand description

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

Required Methods§

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

Create a new Extend of the correct type

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§

§

impl<T> Accumulate<T> for ()

§

fn initial(_capacity: Option<usize>)

§

fn accumulate(&mut self, _acc: T)

§

impl<T> Accumulate<T> for usize

§

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

§

fn accumulate(&mut self, _acc: T)

Implementors§

§

impl Accumulate<char> for String

§

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

§

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

§

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

§

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

§

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

§

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

§

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