struct WsInner {
sink: Option<SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>>,
subscriptions: Vec<Value>,
depth_senders: Vec<UnboundedSender<Result<DepthUpdate, O2Error>>>,
orders_senders: Vec<UnboundedSender<Result<OrderUpdate, O2Error>>>,
trades_senders: Vec<UnboundedSender<Result<TradeUpdate, O2Error>>>,
balances_senders: Vec<UnboundedSender<Result<BalanceUpdate, O2Error>>>,
nonce_senders: Vec<UnboundedSender<Result<NonceUpdate, O2Error>>>,
}Expand description
Shared inner state for the WebSocket connection.
Fields§
§sink: Option<SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>>§subscriptions: Vec<Value>§depth_senders: Vec<UnboundedSender<Result<DepthUpdate, O2Error>>>§orders_senders: Vec<UnboundedSender<Result<OrderUpdate, O2Error>>>§trades_senders: Vec<UnboundedSender<Result<TradeUpdate, O2Error>>>§balances_senders: Vec<UnboundedSender<Result<BalanceUpdate, O2Error>>>§nonce_senders: Vec<UnboundedSender<Result<NonceUpdate, O2Error>>>Implementations§
Source§impl WsInner
impl WsInner
fn new() -> Self
Sourcefn prune_closed_senders(&mut self)
fn prune_closed_senders(&mut self)
Remove closed senders from all sender lists.
Sourcefn close_all_senders(&mut self)
fn close_all_senders(&mut self)
Close all sender channels (signals receivers to terminate).
Sourcefn close_all_senders_with_error(&mut self, msg: &str)
fn close_all_senders_with_error(&mut self, msg: &str)
Send disconnect error to all subscribers, then clear.
Auto Trait Implementations§
impl Freeze for WsInner
impl !RefUnwindSafe for WsInner
impl Send for WsInner
impl Sync for WsInner
impl Unpin for WsInner
impl !UnwindSafe for WsInner
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