Files
daqbuffer/items_2/src/collect.rs
Dominik Werder 7cdf5975b9 WIP on collector
2022-11-18 16:01:35 +01:00

24 lines
446 B
Rust

use crate::Error;
use std::fmt;
pub trait Collector: fmt::Debug {
type Input;
type Output;
fn len(&self) -> usize;
fn ingest(&mut self, item: &mut Self::Input);
fn set_range_complete(&mut self);
fn set_timed_out(&mut self);
fn result(&mut self) -> Result<Self::Output, Error>;
}
pub trait Collectable: fmt::Debug {
type Collector: Collector<Input = Self>;
fn new_collector(&self) -> Self::Collector;
}