pub trait BarAggregator {
// Required methods
fn bar_type(&self) -> BarType;
fn is_running(&self) -> bool;
fn set_await_partial(&mut self, value: bool);
fn set_is_running(&mut self, value: bool);
fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos);
fn update_bar(&mut self, bar: Bar, volume: Quantity, ts_init: UnixNanos);
fn start_batch_update(&mut self, handler: Box<dyn FnMut(Bar)>);
fn stop_batch_update(&mut self);
// Provided methods
fn handle_quote(&mut self, quote: QuoteTick) { ... }
fn handle_trade(&mut self, trade: TradeTick) { ... }
fn handle_bar(&mut self, bar: Bar) { ... }
}
Required Methods§
Sourcefn is_running(&self) -> bool
fn is_running(&self) -> bool
If the aggregator is running and will receive data from the message bus.
fn set_await_partial(&mut self, value: bool)
fn set_is_running(&mut self, value: bool)
Sourcefn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos)
fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos)
Updates theaggregator with the given price and size.
fn update_bar(&mut self, bar: Bar, volume: Quantity, ts_init: UnixNanos)
fn start_batch_update(&mut self, handler: Box<dyn FnMut(Bar)>)
fn stop_batch_update(&mut self)
Provided Methods§
Sourcefn handle_quote(&mut self, quote: QuoteTick)
fn handle_quote(&mut self, quote: QuoteTick)
Updates the aggregator with the given quote.
Sourcefn handle_trade(&mut self, trade: TradeTick)
fn handle_trade(&mut self, trade: TradeTick)
Updates the aggregator with the given trade.