pub struct WsDispatchState {
pub order_identities: DashMap<ClientOrderId, OrderIdentity>,
/* private fields */
}Expand description
Shared state for cross-stream event deduplication between the private and business WebSocket dispatch loops.
Fields§
§order_identities: DashMap<ClientOrderId, OrderIdentity>Implementations§
Source§impl WsDispatchState
impl WsDispatchState
Sourcepub fn contains_accepted(&self, cid: &ClientOrderId) -> bool
pub fn contains_accepted(&self, cid: &ClientOrderId) -> bool
Returns whether acceptance was already emitted for the order.
Sourcepub fn insert_accepted(&self, cid: ClientOrderId, venue_order_id: VenueOrderId)
pub fn insert_accepted(&self, cid: ClientOrderId, venue_order_id: VenueOrderId)
Records that acceptance was emitted for the order.
Sourcepub fn contains_triggered(&self, cid: &ClientOrderId) -> bool
pub fn contains_triggered(&self, cid: &ClientOrderId) -> bool
Returns whether the order was already triggered.
Sourcepub fn insert_triggered(&self, cid: ClientOrderId)
pub fn insert_triggered(&self, cid: ClientOrderId)
Records that the order was triggered.
Sourcepub fn contains_filled(&self, cid: &ClientOrderId) -> bool
pub fn contains_filled(&self, cid: &ClientOrderId) -> bool
Returns whether the order was already filled.
Sourcepub fn insert_filled(&self, cid: ClientOrderId)
pub fn insert_filled(&self, cid: ClientOrderId)
Records that the order was filled.
Sourcepub fn contains_terminal(&self, cid: &ClientOrderId) -> bool
pub fn contains_terminal(&self, cid: &ClientOrderId) -> bool
Returns whether the order already reached a terminal state.
Sourcepub fn insert_terminal(&self, cid: ClientOrderId)
pub fn insert_terminal(&self, cid: ClientOrderId)
Records that the order reached a terminal state.
Sourcepub fn check_and_insert_trade(&self, trade_id: TradeId) -> bool
pub fn check_and_insert_trade(&self, trade_id: TradeId) -> bool
Returns true if this trade was already emitted (duplicate).
Uses atomic insert to avoid TOCTOU races between concurrent streams.
pub fn contains_trade(&self, trade_id: &TradeId) -> bool
Trait Implementations§
Source§impl Debug for WsDispatchState
impl Debug for WsDispatchState
Auto Trait Implementations§
impl !Freeze for WsDispatchState
impl !RefUnwindSafe for WsDispatchState
impl !UnwindSafe for WsDispatchState
impl Send for WsDispatchState
impl Sync for WsDispatchState
impl Unpin for WsDispatchState
impl UnsafeUnpin for WsDispatchState
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<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> ⓘ
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