pub trait XtbStreamConnection {
type MessageStream: MessageStream;
type Error;
// Required methods
fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 mut self,
command: &'life1 str,
arguments: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 mut self,
command: &'life1 str,
arguments: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn make_message_stream<'life0, 'async_trait>(
&'life0 mut self,
filter: DataMessageFilter,
) -> Pin<Box<dyn Future<Output = Self::MessageStream> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Common interface for stream command api of the XTB.
Required Associated Types§
Sourcetype MessageStream: MessageStream
type MessageStream: MessageStream
Type of message stream returned by the make_message_stream method.
type Error
Required Methods§
Sourcefn subscribe<'life0, 'life1, 'async_trait>(
&'life0 mut self,
command: &'life1 str,
arguments: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 mut self,
command: &'life1 str,
arguments: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe for data stream from the XTB server
The arguments must be Value::Object. Any other variants causes an error
Sourcefn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 mut self,
command: &'life1 str,
arguments: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 mut self,
command: &'life1 str,
arguments: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsubscribe from data stream from the XTB server
The arguments value must be Value::Object or Value::Null. Any other variants causes an error
Sourcefn make_message_stream<'life0, 'async_trait>(
&'life0 mut self,
filter: DataMessageFilter,
) -> Pin<Box<dyn Future<Output = Self::MessageStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn make_message_stream<'life0, 'async_trait>(
&'life0 mut self,
filter: DataMessageFilter,
) -> Pin<Box<dyn Future<Output = Self::MessageStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create message stream builder