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 ReportBuilderwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Sample>: Freeze,
*const LeafNode<(String, String), DirectionAccum> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<((String, String), DirectionAccum)>>: Freeze,
*const LeafNode<String, u64> is !null: Freeze,
PhantomData<Box<(String, u64)>>: Freeze,
impl Move for ReportBuilder
impl RefUnwindSafe for ReportBuilder
impl Send for ReportBuilder
impl Sync for ReportBuilder
impl Unpin for ReportBuilder
impl UnsafeUnpin for ReportBuilderwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Sample>: UnsafeUnpin,
*const LeafNode<(String, String), DirectionAccum> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<((String, String), DirectionAccum)>>: UnsafeUnpin,
*const LeafNode<String, u64> is !null: UnsafeUnpin,
PhantomData<Box<(String, u64)>>: UnsafeUnpin,
impl UnwindSafe for ReportBuilderwhere
RawVecInner: UnwindSafe,
BTreeMap<(String, String), DirectionAccum>: UnwindSafe,
BTreeMap<String, u64>: UnwindSafe,
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