pub enum HandlerCommand {
SetClient(WebSocketClient),
Disconnect,
Subscribe {
channel: LighterWsChannel,
auth: Option<String>,
},
Unsubscribe {
channel: LighterWsChannel,
},
ResubscribeOrderBook {
market_index: i16,
},
InitializeInstruments(Vec<(i16, InstrumentAny)>),
UpdateInstrument {
market_index: i16,
instrument: InstrumentAny,
},
SetBookDeltasSub {
market_index: i16,
subscribed: bool,
},
SetDepth10Sub {
market_index: i16,
subscribed: bool,
},
SetExecutionContext {
account_id: AccountId,
account_index: i64,
},
SendTx {
tx_type: u8,
tx_info: Box<RawValue>,
response_tx: Sender<Result<(), LighterWsError>>,
},
}Expand description
Commands sent from the outer client to the inner feed handler.
Variants§
SetClient(WebSocketClient)
Hand the live WebSocketClient to the handler after the outer client
completes the network connect.
Disconnect
Drain the queue and shut the handler down.
Subscribe
Subscribe to a channel. auth carries an optional auth token for the
account-scoped channels.
Unsubscribe
Unsubscribe from a channel.
Fields
channel: LighterWsChannelResubscribeOrderBook
Resubscribe to the venue order_book stream after a continuity gap.
InitializeInstruments(Vec<(i16, InstrumentAny)>)
Replace the handler’s instrument cache (used on initial connect).
UpdateInstrument
Insert or replace a single instrument by market_index.
SetBookDeltasSub
Toggle whether update/order_book frames for market_index should
be emitted as NautilusWsMessage::Deltas.
SetDepth10Sub
Toggle whether update/order_book frames for market_index should
also be emitted as a NautilusWsMessage::Depth10 snapshot.
SetExecutionContext
Provide the execution context (AccountId and venue account_index)
the handler stamps onto reports parsed from account_* frames.
Without this context the handler cannot construct typed reports and
account frames are forwarded as raw JSON instead.
SendTx
Dispatch a signed L2 transaction over the WebSocket.
The handler serializes a LighterWsRequest::SendTx frame; the venue
confirms acceptance via the account_* streams (and reports any
rejection via a control-plane error frame).
Trait Implementations§
Source§impl Debug for HandlerCommand
impl Debug for HandlerCommand
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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