pub struct WsPosition {
pub instrument: Option<String>,
pub balance: Option<Decimal>,
pub entry_price: Option<Decimal>,
pub mark_price: Option<Decimal>,
pub index_price: Option<Decimal>,
pub pnl: Option<Decimal>,
pub effective_leverage: Option<Decimal>,
pub initial_margin: Option<Decimal>,
pub maintenance_margin: Option<Decimal>,
pub return_on_equity: Option<Decimal>,
}Expand description
Position data from WebSocket.
Fields§
§instrument: Option<String>Instrument/symbol.
balance: Option<Decimal>Position balance (positive = long, negative = short).
entry_price: Option<Decimal>Entry price.
mark_price: Option<Decimal>Mark price.
index_price: Option<Decimal>Index price.
pnl: Option<Decimal>PnL (unrealized).
effective_leverage: Option<Decimal>Effective leverage.
initial_margin: Option<Decimal>Initial margin.
maintenance_margin: Option<Decimal>Maintenance margin.
return_on_equity: Option<Decimal>Return on equity.
Trait Implementations§
Source§impl Clone for WsPosition
impl Clone for WsPosition
Source§fn clone(&self) -> WsPosition
fn clone(&self) -> WsPosition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WsPosition
impl Debug for WsPosition
Source§impl<'de> Deserialize<'de> for WsPosition
impl<'de> Deserialize<'de> for WsPosition
Source§fn 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
Auto Trait Implementations§
impl Freeze for WsPosition
impl RefUnwindSafe for WsPosition
impl Send for WsPosition
impl Sync for WsPosition
impl Unpin for WsPosition
impl UnwindSafe for WsPosition
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