pub enum OKXWsMessage {
Show 13 variants
BookData {
arg: OKXWebSocketArg,
action: OKXBookAction,
data: Vec<OKXBookMsg>,
},
ChannelData {
channel: OKXWsChannel,
inst_id: Option<Ustr>,
data: Value,
},
OrderResponse {
id: Option<String>,
op: OKXWsOperation,
code: String,
msg: String,
data: Vec<Value>,
},
Orders(Vec<OKXOrderMsg>),
SpreadOrders(Vec<OKXSpreadOrder>),
AlgoOrders(Vec<OKXAlgoOrderMsg>),
Account(Value),
Positions(Value),
Instruments(Vec<OKXInstrument>),
SendFailed {
request_id: String,
client_order_id: Option<ClientOrderId>,
op: Option<OKXWsOperation>,
error: String,
},
Error(OKXWebSocketError),
Reconnected,
Authenticated,
}Expand description
Output from the OKX WebSocket handler.
Contains venue-specific types only. Data parsing occurs in PyOKXWebSocketClient
(using an instruments cache), and execution parsing occurs in execution.rs
(using the system Cache for order lookups).
Variants§
BookData
Order book snapshot or update.
ChannelData
Data from a non-book channel (trades, tickers, mark price, funding, candles, etc.).
OrderResponse
Response to a WebSocket order command (place, cancel, amend, mass-cancel).
Orders(Vec<OKXOrderMsg>)
Order push channel updates.
SpreadOrders(Vec<OKXSpreadOrder>)
Nitro spread order push channel updates.
AlgoOrders(Vec<OKXAlgoOrderMsg>)
Algo order push channel updates.
Account(Value)
Account channel update (raw JSON).
Positions(Value)
Positions channel update (raw JSON).
Instruments(Vec<OKXInstrument>)
Instrument definition updates.
SendFailed
A WebSocket send failed without a structured venue response.
Fields
op: Option<OKXWsOperation>Error(OKXWebSocketError)
Error received from OKX.
Reconnected
WebSocket reconnected.
Authenticated
WebSocket authenticated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OKXWsMessage
impl RefUnwindSafe for OKXWsMessage
impl Send for OKXWsMessage
impl Sync for OKXWsMessage
impl Unpin for OKXWsMessage
impl UnsafeUnpin for OKXWsMessage
impl UnwindSafe for OKXWsMessage
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>
§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