pub struct AccountsManager { /* private fields */ }
Implementations§
Source§impl AccountsManager
impl AccountsManager
pub fn new(clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>) -> Self
Sourcepub fn update_balances(
&self,
account: AccountAny,
instrument: InstrumentAny,
fill: OrderFilled,
) -> AccountState
pub fn update_balances( &self, account: AccountAny, instrument: InstrumentAny, fill: OrderFilled, ) -> AccountState
Updates the given account state based on a filled order.
§Panics
Panics if the position list for the filled instrument is empty.
pub fn update_orders( &self, account: &AccountAny, instrument: InstrumentAny, orders_open: Vec<&OrderAny>, ts_event: UnixNanos, ) -> Option<(AccountAny, AccountState)>
Sourcepub fn update_positions(
&self,
account: &MarginAccount,
instrument: InstrumentAny,
positions: Vec<&Position>,
ts_event: UnixNanos,
) -> Option<(MarginAccount, AccountState)>
pub fn update_positions( &self, account: &MarginAccount, instrument: InstrumentAny, positions: Vec<&Position>, ts_event: UnixNanos, ) -> Option<(MarginAccount, AccountState)>
Updates the account based on current open positions.
§Panics
Panics if any position’s instrument_id
does not match the provided instrument
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AccountsManager
impl !RefUnwindSafe for AccountsManager
impl !Send for AccountsManager
impl !Sync for AccountsManager
impl Unpin for AccountsManager
impl !UnwindSafe for AccountsManager
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