measured_future_rs/report_sinks/aggregating/
impl_aggregating.rs1use super::*;
2
3impl<R, S> AggregatingSink<R, S>
4where
5 R: Default,
6{
7 pub fn new(pass_to: S) -> Self {
8 Self {
9 flush_interval: DEFAULT_FLUSH_INTERVAL,
10 last_flushed_at: Instant::now(),
11 current: Default::default(),
12 flush_requested: false,
13 pass_to,
14 }
15 }
16}
17
18impl<R, S> AggregatingSink<R, S> {
19 pub fn with_flush_interval(self, flush_interval: Duration) -> Self {
20 Self {
21 flush_interval,
22 ..self
23 }
24 }
25}