BrokerClient

Trait BrokerClient 

Source
pub trait BrokerClient: Send + Sync {
    // Required methods
    fn get_account<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Account>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_positions<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Position>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn place_order<'life0, 'async_trait>(
        &'life0 self,
        order: OrderRequest,
    ) -> Pin<Box<dyn Future<Output = Result<OrderResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cancel_order<'life0, 'life1, 'async_trait>(
        &'life0 self,
        order_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_order<'life0, 'life1, 'async_trait>(
        &'life0 self,
        order_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<OrderResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_orders<'life0, 'async_trait>(
        &'life0 self,
        filter: OrderFilter,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<OrderResponse>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Broker client trait

Required Methods§

Source

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

Get account information

Source

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

Get current positions

Source

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

Place an order

Source

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

Cancel an order

Source

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

Get order status

Source

fn list_orders<'life0, 'async_trait>( &'life0 self, filter: OrderFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<OrderResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all orders with optional filter

Source

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

Health check

Implementors§