pub struct Account<A> { /* private fields */ }
Expand description
The users account
Implementations
sourceimpl<A> Account<A>where
A: AccountTracker,
impl<A> Account<A>where
A: AccountTracker,
sourcepub fn set_position(&mut self, position: Position)
pub fn set_position(&mut self, position: Position)
Set a new position manually, be sure that you know what you are doing
sourcepub fn set_margin(&mut self, margin: Margin)
pub fn set_margin(&mut self, margin: Margin)
Set a new margin manually, be sure that you know what you are doing when using this method Returns true if successful
sourcepub fn active_limit_orders(&self) -> &HashMap<u64, Order>
pub fn active_limit_orders(&self) -> &HashMap<u64, Order>
Return the currently active limit orders
sourcepub fn account_tracker(&self) -> &A
pub fn account_tracker(&self) -> &A
Return a reference to acc_tracker struct
sourcepub fn cancel_order(&mut self, order_id: u64) -> Result<Order>
pub fn cancel_order(&mut self, order_id: u64) -> Result<Order>
Cancel an active order returns Some order if successful with given order_id
sourcepub fn cancel_order_by_user_id(&mut self, user_order_id: u64) -> Result<Order>
pub fn cancel_order_by_user_id(&mut self, user_order_id: u64) -> Result<Order>
Cancel an active order based on the user_order_id of an Order
Returns
the cancelled order if successfull, error when the user_order_id is not found
sourcepub fn cancel_all_orders(&mut self)
pub fn cancel_all_orders(&mut self)
Cancel all active orders
sourcepub fn open_limit_buy_size(&self) -> f64
pub fn open_limit_buy_size(&self) -> f64
Cumulative open limit order size of buy orders
sourcepub fn open_limit_sell_size(&self) -> f64
pub fn open_limit_sell_size(&self) -> f64
Cumulative
Trait Implementations
Auto Trait Implementations
impl<A> RefUnwindSafe for Account<A>where
A: RefUnwindSafe,
impl<A> Send for Account<A>where
A: Send,
impl<A> Sync for Account<A>where
A: Sync,
impl<A> Unpin for Account<A>where
A: Unpin,
impl<A> UnwindSafe for Account<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more