pub trait PositionStateMut<const DECIMALS: u8>: PositionState<DECIMALS> {
// Required methods
fn collateral_amount_mut(&mut self) -> &mut Self::Num;
fn size_in_usd_mut(&mut self) -> &mut Self::Num;
fn size_in_tokens_mut(&mut self) -> &mut Self::Num;
fn borrowing_factor_mut(&mut self) -> &mut Self::Num;
fn funding_fee_amount_per_size_mut(&mut self) -> &mut Self::Num;
fn claimable_funding_fee_amount_per_size_mut(
&mut self,
is_long_collateral: bool,
) -> &mut Self::Num;
}Expand description
Mutable access to the position state.
Required Methods§
Sourcefn collateral_amount_mut(&mut self) -> &mut Self::Num
fn collateral_amount_mut(&mut self) -> &mut Self::Num
Get a mutable reference to the collateral amount.
Sourcefn size_in_usd_mut(&mut self) -> &mut Self::Num
fn size_in_usd_mut(&mut self) -> &mut Self::Num
Get a mutable reference to the size (in USD) of the position.
Sourcefn size_in_tokens_mut(&mut self) -> &mut Self::Num
fn size_in_tokens_mut(&mut self) -> &mut Self::Num
Get a mutable reference to the size (in tokens) of the position.
Sourcefn borrowing_factor_mut(&mut self) -> &mut Self::Num
fn borrowing_factor_mut(&mut self) -> &mut Self::Num
Get a mutable reference to last borrowing factor applied by the position.
Sourcefn funding_fee_amount_per_size_mut(&mut self) -> &mut Self::Num
fn funding_fee_amount_per_size_mut(&mut self) -> &mut Self::Num
Get a mutable reference to the funding fee amount per size.
Sourcefn claimable_funding_fee_amount_per_size_mut(
&mut self,
is_long_collateral: bool,
) -> &mut Self::Num
fn claimable_funding_fee_amount_per_size_mut( &mut self, is_long_collateral: bool, ) -> &mut Self::Num
Get a mutable reference to claimable funding fee amount per size of the given collateral.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<const DECIMALS: u8, P: PositionStateMut<DECIMALS>> PositionStateMut<DECIMALS> for &mut P
impl<const DECIMALS: u8, P: PositionStateMut<DECIMALS>> PositionStateMut<DECIMALS> for &mut P
fn collateral_amount_mut(&mut self) -> &mut Self::Num
fn size_in_usd_mut(&mut self) -> &mut Self::Num
fn size_in_tokens_mut(&mut self) -> &mut Self::Num
fn borrowing_factor_mut(&mut self) -> &mut Self::Num
fn funding_fee_amount_per_size_mut(&mut self) -> &mut Self::Num
fn claimable_funding_fee_amount_per_size_mut( &mut self, is_long_collateral: bool, ) -> &mut Self::Num
Implementors§
impl<T, const DECIMALS: u8> PositionStateMut<DECIMALS> for TestPositionOps<'_, T, DECIMALS>
Available on crate features
test only.