Acc

Trait Acc 

Source
pub trait Acc {
    type Item;

    // Required method
    fn acc(self, item: Self::Item) -> Self;
}
Expand description

This is very usefull to be use on combinator like fold. For example, .fold_bounds(.., Vec::new, Acc::acc).

Required Associated Types§

Source

type Item

Item stocked in the collection

Required Methods§

Source

fn acc(self, item: Self::Item) -> Self

Accumulate item into Self. For example, for a vector that simply a push.

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.

Implementors§

Source§

impl<T> Acc for T
where Self: Push,

Source§

type Item = <T as Push>::Item