pub struct AccountState { /* private fields */ }Implementations§
Source§impl AccountState
impl AccountState
pub const fn new( balances: FnvHashMap<AssetNameExchange, AssetBalance<AssetNameExchange>>, orders_open: FnvHashMap<ClientOrderId, Order<ExchangeId, InstrumentNameExchange, Open>>, orders_cancelled: FnvHashMap<ClientOrderId, Order<ExchangeId, InstrumentNameExchange, Cancelled>>, trades: Vec<Trade<AssetNameExchange, InstrumentNameExchange>>, ) -> AccountState
Source§impl AccountState
impl AccountState
pub fn update_time_exchange(&mut self, time_exchange: DateTime<Utc>)
pub fn balances( &self, ) -> impl Iterator<Item = &AssetBalance<AssetNameExchange>> + '_
pub fn orders_open( &self, ) -> impl Iterator<Item = &Order<ExchangeId, InstrumentNameExchange, Open>> + '_
pub fn orders_cancelled( &self, ) -> impl Iterator<Item = &Order<ExchangeId, InstrumentNameExchange, Cancelled>> + '_
pub fn trades( &self, time_since: DateTime<Utc>, ) -> impl Iterator<Item = &Trade<AssetNameExchange, InstrumentNameExchange>> + '_
pub fn balance_mut( &mut self, asset: &AssetNameExchange, ) -> Option<&mut AssetBalance<AssetNameExchange>>
pub fn ack_trade( &mut self, trade: Trade<AssetNameExchange, InstrumentNameExchange>, )
Trait Implementations§
Source§impl Debug for AccountState
impl Debug for AccountState
Source§impl From<AccountSnapshot<ExchangeId, AssetNameExchange, InstrumentNameExchange>> for AccountState
impl From<AccountSnapshot<ExchangeId, AssetNameExchange, InstrumentNameExchange>> for AccountState
Source§fn from(value: UnindexedAccountSnapshot) -> Self
fn from(value: UnindexedAccountSnapshot) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AccountState
impl RefUnwindSafe for AccountState
impl Send for AccountState
impl Sync for AccountState
impl Unpin for AccountState
impl UnsafeUnpin for AccountState
impl UnwindSafe for AccountState
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more