pub trait OrderService: Send + Sync {
// Required methods
fn create_order<'life0, 'life1, 'async_trait>(
&'life0 self,
order: &'life1 CreateOrderRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateOrderResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_order_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
deal_reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderConfirmationResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_position<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
deal_id: &'life1 str,
update: &'life2 UpdatePositionRequest,
) -> Pin<Box<dyn Future<Output = Result<UpdatePositionResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn close_position<'life0, 'life1, 'async_trait>(
&'life0 self,
close_request: &'life1 ClosePositionRequest,
) -> Pin<Box<dyn Future<Output = Result<ClosePositionResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_working_order<'life0, 'life1, 'async_trait>(
&'life0 self,
order: &'life1 CreateWorkingOrderRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateWorkingOrderResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Service for creating, updating, and managing trading orders with the IG Markets API
This trait defines the interface for interacting with the IG Markets order endpoints, allowing clients to create new orders, get order confirmations, update existing positions, and close positions.
Required Methods§
Sourcefn create_order<'life0, 'life1, 'async_trait>(
&'life0 self,
order: &'life1 CreateOrderRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateOrderResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_order<'life0, 'life1, 'async_trait>(
&'life0 self,
order: &'life1 CreateOrderRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateOrderResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new order
Sourcefn get_order_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
deal_reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderConfirmationResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_order_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
deal_reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderConfirmationResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets the confirmation of an order
Sourcefn update_position<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
deal_id: &'life1 str,
update: &'life2 UpdatePositionRequest,
) -> Pin<Box<dyn Future<Output = Result<UpdatePositionResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_position<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
deal_id: &'life1 str,
update: &'life2 UpdatePositionRequest,
) -> Pin<Box<dyn Future<Output = Result<UpdatePositionResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Updates an existing position
Sourcefn close_position<'life0, 'life1, 'async_trait>(
&'life0 self,
close_request: &'life1 ClosePositionRequest,
) -> Pin<Box<dyn Future<Output = Result<ClosePositionResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn close_position<'life0, 'life1, 'async_trait>(
&'life0 self,
close_request: &'life1 ClosePositionRequest,
) -> Pin<Box<dyn Future<Output = Result<ClosePositionResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Closes an existing position
Sourcefn create_working_order<'life0, 'life1, 'async_trait>(
&'life0 self,
order: &'life1 CreateWorkingOrderRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateWorkingOrderResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_working_order<'life0, 'life1, 'async_trait>(
&'life0 self,
order: &'life1 CreateWorkingOrderRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateWorkingOrderResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new working order