xtb_client

Trait XtbStreamConnection

Source
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§

Source

type MessageStream: MessageStream

Type of message stream returned by the make_message_stream method.

Source

type Error

Required Methods§

Source

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

Source

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

Source

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

Implementors§