pub struct Stream { /* private fields */ }Expand description
WebSocket connection driver.
Stream::new spawns the driver on the current Tokio runtime and returns a
Handle for commands and a receiver of Events.
§Reconnects
After an unexpected disconnect the driver reconnects automatically (see
Config::max_reconnect_attempts) and emits Event::Connected again.
Subscriptions and authentication are not restored: after every
Event::Connected the user must send auth (private streams) and
subscribe again.
§Event delivery
Lifecycle events (Connected, Reconnecting, Disconnected) are always
delivered: the driver waits for free space in the event queue. Market and
account data (Message, ParseError) are dropped when the queue is full;
the number of dropped events is reported by Event::Lagged as soon as
there is room again.
Implementations§
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl UnwindSafe for Stream
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