pub struct Margin { /* private fields */ }
Expand description
Describes the margin information of the account
Implementations
sourceimpl Margin
impl Margin
sourcepub fn new_init(init_balance: f64) -> Self
pub fn new_init(init_balance: f64) -> Self
Create a new margin account with an initial balance
Panics
sourcepub fn new(
wallet_balance: f64,
position_margin: f64,
order_margin: f64,
available_balance: f64
) -> Self
pub fn new(
wallet_balance: f64,
position_margin: f64,
order_margin: f64,
available_balance: f64
) -> Self
Create a new Margin with all fields custom
Panics
In debug mode, if the input values don’t make sense
sourcepub fn wallet_balance(&self) -> f64
pub fn wallet_balance(&self) -> f64
Return the wallet balance of account denoted in QUOTE currency when using linear futures denoted in BASE currency when using inverse futures
sourcepub fn position_margin(&self) -> f64
pub fn position_margin(&self) -> f64
Return the position margin of account, same denotation as wallet_balance
sourcepub fn order_margin(&self) -> f64
pub fn order_margin(&self) -> f64
Return the used order margin of account, same denotation as wallet_balance
sourcepub fn available_balance(&self) -> f64
pub fn available_balance(&self) -> f64
Return the available balance of account, same denotation as wallet_balance
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Margin
impl<'de> Deserialize<'de> for Margin
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Margin
Auto Trait Implementations
impl RefUnwindSafe for Margin
impl Send for Margin
impl Sync for Margin
impl Unpin for Margin
impl UnwindSafe for Margin
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