pub enum IncomingMessage {
Command(CommandMsg),
TradeReply(Box<TradeReply>),
Ticker(Box<TickerMsg>),
Trade(TradeMsg),
KLine(KLineMsg),
Orderbook(OrderbookMsg),
AllLiquidation(AllLiquidationMsg),
Topic(TopicMessage),
}Expand description
A message from a Bybit stream; parse it with IncomingMessage::from_json.
Variants§
Command(CommandMsg)
Reply to a command (subscribe, auth, heartbeat, …).
TradeReply(Box<TradeReply>)
Reply of the order entry stream (/v5/trade): auth, order.*.
Ticker(Box<TickerMsg>)
Ticker (tickers.*).
Trade(TradeMsg)
Public trades (publicTrade.*).
KLine(KLineMsg)
Klines (kline.*).
Orderbook(OrderbookMsg)
Order book (orderbook.*).
AllLiquidation(AllLiquidationMsg)
Liquidations (allLiquidation.*).
Topic(TopicMessage)
Private stream data (orders, positions, executions, wallet, …).
Implementations§
Source§impl IncomingMessage
impl IncomingMessage
Sourcepub fn from_json(json: &str) -> Result<Self, Error<Error>>
pub fn from_json(json: &str) -> Result<Self, Error<Error>>
Parse a WebSocket text frame.
Prefer this over the derived Deserialize impl (which is
#[serde(untagged)] and tries every variant in turn): the op/topic
fields are read first and only the matching type is deserialized, so
errors point at the offending field (e.g. data.b[0]) and topics with
a category suffix such as order.linear are recognized.
Trait Implementations§
Source§impl Debug for IncomingMessage
impl Debug for IncomingMessage
Source§impl<'de> Deserialize<'de> for IncomingMessage
impl<'de> Deserialize<'de> for IncomingMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for IncomingMessage
impl PartialEq for IncomingMessage
impl StructuralPartialEq for IncomingMessage
Auto Trait Implementations§
impl Freeze for IncomingMessage
impl RefUnwindSafe for IncomingMessage
impl Send for IncomingMessage
impl Sync for IncomingMessage
impl Unpin for IncomingMessage
impl UnsafeUnpin for IncomingMessage
impl UnwindSafe for IncomingMessage
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