Skip to main content

CollectorFor

Trait CollectorFor 

Source
pub trait CollectorFor<F: RecFamily> {
    // Required method
    fn push_rec<'buf>(&mut self, rec: Record<F::Rec<'buf>>) -> Flow;
}
Expand description

Family-erased collector: accepts the family’s record type at any buffer lifetime through a lifetime-generic method, which keeps it dyn-compatible. This is what lets flat_map closures hold a plain &mut Emitter<'_, OutF> without naming the downstream stack type.

Required Methods§

Source

fn push_rec<'buf>(&mut self, rec: Record<F::Rec<'buf>>) -> Flow

Push one record of the family at any lifetime.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, C> CollectorFor<F> for C
where F: RecFamily, C: for<'buf> Collector<<F as RecFamily>::Rec<'buf>>,