pub struct BarBuilder { /* private fields */ }
Expand description
Provides a generic bar builder for aggregation.
Implementations§
Source§impl BarBuilder
impl BarBuilder
Sourcepub fn new(instrument: &InstrumentAny, bar_type: BarType) -> Self
pub fn new(instrument: &InstrumentAny, bar_type: BarType) -> Self
Creates a new BarBuilder
instance.
§Panics
This function panics:
- If
instrument.id
is not equal to thebar_type.instrument_id
. - If
bar_type.aggregation_source
is 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.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more