pub enum WsOutgoing {
Subscribe(MarketDataSubscribe),
Unsubscribe(MarketDataSubscribe),
}Expand description
A command a session sends to the broker. It serializes as the plain command, without a wrapper.
The two variants hold the same type: the difference is only the purpose, and the session turns an
unsubscribe into a command with subscribeType = 1.
§Examples
use brokapi_bcs_protocol::models::instrument::InstrumentKey;
use brokapi_bcs_protocol::ws::models::{MarketDataSubscribe, WsOutgoing};
let keys = vec![InstrumentKey::new("SBER", "TQBR")];
let msg = WsOutgoing::Subscribe(MarketDataSubscribe::quotes(keys));
let json = serde_json::to_value(&msg)?;
assert_eq!(json["dataType"], 3);
assert_eq!(json["subscribeType"], 0);Variants§
Subscribe(MarketDataSubscribe)
A subscribe command.
Unsubscribe(MarketDataSubscribe)
An unsubscribe command.
Trait Implementations§
Source§impl Clone for WsOutgoing
impl Clone for WsOutgoing
Source§fn clone(&self) -> WsOutgoing
fn clone(&self) -> WsOutgoing
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WsOutgoing
impl Debug for WsOutgoing
Source§impl PartialEq for WsOutgoing
impl PartialEq for WsOutgoing
Source§fn eq(&self, other: &WsOutgoing) -> bool
fn eq(&self, other: &WsOutgoing) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for WsOutgoing
impl Serialize for WsOutgoing
impl StructuralPartialEq for WsOutgoing
Auto Trait Implementations§
impl Freeze for WsOutgoing
impl RefUnwindSafe for WsOutgoing
impl Send for WsOutgoing
impl Sync for WsOutgoing
impl Unpin for WsOutgoing
impl UnsafeUnpin for WsOutgoing
impl UnwindSafe for WsOutgoing
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