pub trait StreamApi {
type Error;
type Stream<T: Send + Sync + for<'de> Deserialize<'de>>;
// Required methods
fn subscribe_balance<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetBalanceSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetBalanceData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_candles<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetCandlesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetCandlesData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_keep_alive<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetKeepAliveSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetKeepAliveData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_news<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetNewsSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetNewsData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_profits<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetProfitSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetProfitData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_tick_prices<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTickPricesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTickPricesData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_trades<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTradesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTradesData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_trade_status<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTradeStatusSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTradeStatusData>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Declaration of the stream API interface
Required Associated Types§
type Stream<T: Send + Sync + for<'de> Deserialize<'de>>
Required Methods§
Sourcefn subscribe_balance<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetBalanceSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetBalanceData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_balance<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetBalanceSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetBalanceData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Each streaming command takes as an argument streamSessionId which is sent in response message for login command performed in main connection. streamSessionId token allows to identify user in streaming connection. In one streaming connection multiple commands with different streamSessionId can be invoked. It will cause sending streaming data for multiple login sessions in one streaming connection. streamSessionId is valid until logout command is performed on main connection or main connection is disconnected.
Sourcefn subscribe_candles<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetCandlesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetCandlesData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_candles<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetCandlesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetCandlesData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribes for and unsubscribes from API chart candles. The interval of every candle is 1 minute. A new candle arrives every minute.
Sourcefn subscribe_keep_alive<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetKeepAliveSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetKeepAliveData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_keep_alive<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetKeepAliveSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetKeepAliveData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribes for and unsubscribes from ‘keep alive’ messages. A new ‘keep alive’ message is sent by the API every 3 seconds.
Sourcefn subscribe_news<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetNewsSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetNewsData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_news<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetNewsSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetNewsData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribes for and unsubscribes from news.
Sourcefn subscribe_profits<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetProfitSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetProfitData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_profits<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetProfitSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetProfitData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribes for and unsubscribes from profits.
Sourcefn subscribe_tick_prices<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTickPricesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTickPricesData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_tick_prices<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTickPricesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTickPricesData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Establishes subscription for quotations and allows to obtain the relevant information in real-time, as soon as it is available in the system. The getTickPrices command can be invoked many times for the same symbol, but only one subscription for a given symbol will be created. Please beware that when multiple records are available, the order in which they are received is not guaranteed.
Sourcefn subscribe_trades<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTradesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTradesData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_trades<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTradesSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTradesData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Establishes subscription for user trade status data and allows to obtain the relevant information in real-time, as soon as it is available in the system. Please beware that when multiple records are available, the order in which they are received is not guaranteed.
Sourcefn subscribe_trade_status<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTradeStatusSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTradeStatusData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_trade_status<'life0, 'async_trait>(
&'life0 mut self,
arguments: StreamGetTradeStatusSubscribe,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<StreamGetTradeStatusData>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Allows to get status for sent trade requests in real-time, as soon as it is available in the system. Please beware that when multiple records are available, the order in which they are received is not guaranteed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.