pub enum Event {
Connected,
Authenticated,
AuthFailed {
ret_msg: Option<String>,
},
SubscribeFailed {
topics: Vec<Topic>,
ret_msg: Option<String>,
},
Message(IncomingMessage),
ParseError(String),
Lagged {
dropped: u64,
},
Reconnecting {
attempt: u32,
delay_ms: u64,
},
Disconnected {
reason: DisconnectReason,
},
}Expand description
Events from the driver, received from Stream::new.
Variants§
Connected
The connection is open. With credentials configured, auth has been
sent; subscriptions follow once it succeeds.
Authenticated
The stream accepted the credentials (private streams).
AuthFailed
The stream rejected the credentials; no topics are subscribed on this connection.
SubscribeFailed
The stream rejected a subscribe sent by the driver for topics.
Fields
Message(IncomingMessage)
A message from the stream (data or a reply to a command).
ParseError(String)
A WebSocket text frame arrived but could not be deserialized. The connection stays open — the raw error description is included.
Lagged
dropped data events (Message/ParseError) were discarded because
the event queue was full. Local state built from the stream (e.g. an
order book) may be stale and should be resynchronized.
Reconnecting
The connection was lost; the driver reconnects after delay_ms.
Fields
Disconnected
The connection is closed and will not be reopened automatically.
Fields
reason: DisconnectReasonWhy the connection was closed.