pub enum HandlerCommand {
SetClient(WebSocketClient),
Disconnect,
ReplaySubscriptions,
Subscribe {
request_id: i64,
symbol: Ustr,
spec: AxMdSubscriptionSpec,
},
WriteBook {
request_id: i64,
unsubscribe_request_id: Option<i64>,
symbol: Ustr,
spec: AxMdSubscriptionSpec,
cancel: CancellationToken,
gate: SnapshotGate,
completion: Sender<Result<(), AxWsClientError>>,
},
Unsubscribe {
request_id: i64,
symbol: Ustr,
topic: String,
},
SubscribeCandles {
request_id: i64,
symbol: Ustr,
width: AxCandleWidth,
},
UnsubscribeCandles {
request_id: i64,
symbol: Ustr,
width: AxCandleWidth,
topic: String,
},
}Expand description
Commands sent from the outer client to the inner message handler.
Variants§
SetClient(WebSocketClient)
Set the WebSocket client for this handler.
Disconnect
Disconnect the WebSocket connection.
ReplaySubscriptions
Replay all subscriptions after a reconnection.
Subscribe
Subscribe to market data for a symbol.
WriteBook
Writes a book subscription on the current connection, opening gate once written.
With an unsubscribe request ID, first unsubscribes the symbol so the venue restarts its
stream with a snapshot. That acknowledgement stays untracked, keeping the topic desired for
reconnect replay. The write always runs, since the subscription state already counts it;
cancel only keeps the gate closed.
Fields
symbol: UstrInstrument symbol.
spec: AxMdSubscriptionSpecMarket data subscription options.
cancel: CancellationTokenKeeps the gate closed once cancelled.
gate: SnapshotGateSnapshot gate opened once the write completes.
completion: Sender<Result<(), AxWsClientError>>Receives the write result.
Unsubscribe
Unsubscribe from market data for a symbol.
Fields
symbol: UstrInstrument symbol.
SubscribeCandles
Subscribe to candle data for a symbol.
UnsubscribeCandles
Unsubscribe from candle data for a symbol.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HandlerCommand
impl !UnwindSafe for HandlerCommand
impl Freeze for HandlerCommand
impl Send for HandlerCommand
impl Sync for HandlerCommand
impl Unpin for HandlerCommand
impl UnsafeUnpin for HandlerCommand
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
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