pub struct ReportBuilder { /* private fields */ }Expand description
Accumulates a Report one record at a time, holding pricing samples, one accumulator per
trade direction, and the venue labels seen — never the records.
Every price is a median over the whole stream, so amounts accumulate raw and convert once in
ReportBuilder::finish. Prices::usd is linear in the amount, which is what makes that
identical to converting each hop as it arrives.
Implementations§
Source§impl ReportBuilder
impl ReportBuilder
Sourcepub fn push(&mut self, record: &LegRecord)
pub fn push(&mut self, record: &LegRecord)
Take one record’s contribution. Cheap and order-independent.
Sourcepub fn finish(self) -> Result<Report, RerouteReportError>
pub fn finish(self) -> Result<Report, RerouteReportError>
Price the accumulated flow into a Report. Fails with
RerouteReportError::NothingMatched when no hop on either side matched the target.
Auto Trait Implementations§
impl Forget for ReportBuilder
impl Freeze for ReportBuilder
impl Move for ReportBuilder
impl RefUnwindSafe for ReportBuilder
impl Send for ReportBuilder
impl Sync for ReportBuilder
impl Unpin for ReportBuilder
impl UnsafeUnpin for ReportBuilder
impl UnwindSafe for ReportBuilder
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