pub struct DefaultPositionManager { /* private fields */ }Expand description
Default implementation of position manager
Implementations§
Source§impl DefaultPositionManager
impl DefaultPositionManager
Sourcepub fn new(event_sender: Option<Sender<PositionEvent>>) -> Self
pub fn new(event_sender: Option<Sender<PositionEvent>>) -> Self
Create a new position manager
Trait Implementations§
Source§impl PositionManager for DefaultPositionManager
impl PositionManager for DefaultPositionManager
Source§fn update_position<'life0, 'async_trait>(
&'life0 self,
update: PositionUpdate,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_position<'life0, 'async_trait>(
&'life0 self,
update: PositionUpdate,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update or create a position from exchange update
Source§fn get_position<'life0, 'life1, 'async_trait>(
&'life0 self,
position_id: &'life1 PositionId,
) -> Pin<Box<dyn Future<Output = Option<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_position<'life0, 'life1, 'async_trait>(
&'life0 self,
position_id: &'life1 PositionId,
) -> Pin<Box<dyn Future<Output = Option<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get position by ID
Source§fn get_positions_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
venue: Venue,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_positions_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
venue: Venue,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all positions for a symbol on a venue
Source§fn get_all_positions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_positions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all open positions
Source§fn get_total_unrealized_pnl<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Decimal> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_unrealized_pnl<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Decimal> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total unrealized
PnL across all positionsAuto Trait Implementations§
impl Freeze for DefaultPositionManager
impl !RefUnwindSafe for DefaultPositionManager
impl Send for DefaultPositionManager
impl Sync for DefaultPositionManager
impl Unpin for DefaultPositionManager
impl !UnwindSafe for DefaultPositionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more