pub enum BcsWsChannel {
Limits,
Portfolio,
MarketData,
OrderExecution,
OrderTransaction,
OrderEvents,
MarginalIndicators,
}Expand description
A WebSocket channel (service) of the BCS API. Each channel is its own URL and its own connection.
Only BcsWsChannel::MarketData takes subscription commands. The others push their data as soon as
they are connected, with nothing to send.
The broker limits the number of simultaneous connections per account: 2 for portfolio, limits and margin indicators, 4 for orders, 20 for market data (broker docs). It also limits the client to 10 messages per second and 100 instruments per connection.
§Examples
use brokapi_bcs_protocol::ws::client::BcsWsChannel;
let channel: BcsWsChannel = serde_json::from_str("\"market_data\"")?;
assert_eq!(channel, BcsWsChannel::MarketData);Variants§
Limits
Account limits: positions, money, futures limits (limits/ws). Parsed into
IncomingMessage::Limits.
Portfolio
Portfolio positions with values and P/L (portfolio/ws). Parsed into
IncomingMessage::Portfolio.
MarketData
Market data: quotes, order book, trades tape and last candle (market-data/ws). The only
channel that takes subscriptions. Parsed into IncomingMessage::MarketData.
OrderExecution
Deprecated order execution channel (orders/execution/ws). The broker docs mark it
deprecated: use BcsWsChannel::OrderEvents. Parsed into IncomingMessage::OrderExecution.
OrderTransaction
Deprecated order transaction channel (orders/transaction/ws). The broker docs mark it
deprecated: use BcsWsChannel::OrderEvents. Parsed into IncomingMessage::OrderTransaction.
OrderEvents
Current order status channel (orders/events/ws), replaces execution-status and
transaction-status, which the docs now mark deprecated. Parsed into
IncomingMessage::OrderExecution.
MarginalIndicators
Margin indicators: portfolio value, margin level, debts (marginal-indicators/ws). Parsed into
IncomingMessage::MarginalIndicators.
Trait Implementations§
Source§impl Clone for BcsWsChannel
impl Clone for BcsWsChannel
Source§fn clone(&self) -> BcsWsChannel
fn clone(&self) -> BcsWsChannel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BcsWsChannel
Source§impl Debug for BcsWsChannel
impl Debug for BcsWsChannel
Source§impl<'de> Deserialize<'de> for BcsWsChannel
impl<'de> Deserialize<'de> for BcsWsChannel
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>,
impl Eq for BcsWsChannel
Source§impl PartialEq for BcsWsChannel
impl PartialEq for BcsWsChannel
Source§fn eq(&self, other: &BcsWsChannel) -> bool
fn eq(&self, other: &BcsWsChannel) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BcsWsChannel
Auto Trait Implementations§
impl Freeze for BcsWsChannel
impl RefUnwindSafe for BcsWsChannel
impl Send for BcsWsChannel
impl Sync for BcsWsChannel
impl Unpin for BcsWsChannel
impl UnsafeUnpin for BcsWsChannel
impl UnwindSafe for BcsWsChannel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.