Trait Exchange

Source
pub trait Exchange: Send + Sync {
    // Required methods
    fn send_order<'life0, 'async_trait>(
        &'life0 self,
        order: Order,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cancel_order<'life0, 'async_trait>(
        &'life0 self,
        order_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_order_status<'life0, 'async_trait>(
        &'life0 self,
        order_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for exchange implementations

Required Methods§

Source

fn send_order<'life0, 'async_trait>( &'life0 self, order: Order, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send an order to the exchange

Source

fn cancel_order<'life0, 'async_trait>( &'life0 self, order_id: String, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel an existing order

Source

fn get_order_status<'life0, 'async_trait>( &'life0 self, order_id: String, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the current status of an order

Implementors§