pub struct BarBuilder { /* private fields */ }Expand description
Provides a generic bar builder for aggregation.
Implementations§
Source§impl BarBuilder
impl BarBuilder
Sourcepub fn new(bar_type: BarType, price_precision: u8, size_precision: u8) -> Self
pub fn new(bar_type: BarType, price_precision: u8, size_precision: u8) -> Self
Creates a new BarBuilder instance.
§Panics
This function panics:
- If
instrument.idis not equal to thebar_type.instrument_id. - If
bar_type.aggregation_sourceis not equal toAggregationSource::Internal.
Sourcepub fn set_partial(&mut self, partial_bar: Bar)
pub fn set_partial(&mut self, partial_bar: Bar)
Set the initial values for a partially completed bar.
Sourcepub fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos)
pub fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos)
Update the bar builder.
pub fn update_bar(&mut self, bar: Bar, volume: Quantity, ts_init: UnixNanos)
Auto Trait Implementations§
impl Freeze for BarBuilder
impl RefUnwindSafe for BarBuilder
impl Send for BarBuilder
impl Sync for BarBuilder
impl Unpin for BarBuilder
impl UnwindSafe for BarBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more