pub struct PrivateState { /* private fields */ }Expand description
Execution state the private stream uses to turn venue evidence into order events.
Implementations§
Source§impl PrivateState
impl PrivateState
Sourcepub fn seed_positions(
&mut self,
positions: impl IntoIterator<Item = (InstrumentId, Decimal, UnixNanos)>,
) -> Result<()>
pub fn seed_positions( &mut self, positions: impl IntoIterator<Item = (InstrumentId, Decimal, UnixNanos)>, ) -> Result<()>
Records opening position evidence once.
Later calls keep the first seed until an accounting rebase. Each restored order receives a zero net when the seed omits its instrument.
§Errors
Returns an error if a supplied net overflows.
Sourcepub fn restore(&mut self, order: OrderAny)
pub fn restore(&mut self, order: OrderAny)
Inserts or replaces one cached order when the incoming record is not older.
A new cached order that already has fills rebases private cash when the ledger has a known total.
Sourcepub fn plan_order(
&self,
source: &VenueOrder,
fills: &[FillReport],
instrument: &BinaryOption,
emitter: &ExecutionEventEmitter,
ts_init: UnixNanos,
) -> Result<Option<OrderPlan>>
pub fn plan_order( &self, source: &VenueOrder, fills: &[FillReport], instrument: &BinaryOption, emitter: &ExecutionEventEmitter, ts_init: UnixNanos, ) -> Result<Option<OrderPlan>>
Plans the order and fill events one venue order requires.
Returns Ok(None) when the venue record is already covered. The plan is not emitted until
Self::apply_plans.
Owned limit orders retain independently valid fills with an unmapped type or status. These plans keep recovery unresolved. Fills that require unconfirmed quantity wait for authoritative order terms.
§Errors
Returns an error if identity, counts, prices, or timestamps are inconsistent, an external order has an unmapped classification, or fills require unconfirmed order quantity.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrivateState
impl RefUnwindSafe for PrivateState
impl Send for PrivateState
impl Sync for PrivateState
impl Unpin for PrivateState
impl UnsafeUnpin for PrivateState
impl UnwindSafe for PrivateState
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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