pub struct DecreasePosition<P: Position<DECIMALS>, const DECIMALS: u8> { /* private fields */ }
Expand description
Decrease the position.
Implementations§
Source§impl<const DECIMALS: u8, P: PositionMut<DECIMALS>> DecreasePosition<P, DECIMALS>
impl<const DECIMALS: u8, P: PositionMut<DECIMALS>> DecreasePosition<P, DECIMALS>
Sourcepub fn try_new(
position: P,
prices: Prices<P::Num>,
size_delta_usd: P::Num,
acceptable_price: Option<P::Num>,
collateral_withdrawal_amount: P::Num,
flags: DecreasePositionFlags,
) -> Result<Self>
pub fn try_new( position: P, prices: Prices<P::Num>, size_delta_usd: P::Num, acceptable_price: Option<P::Num>, collateral_withdrawal_amount: P::Num, flags: DecreasePositionFlags, ) -> Result<Self>
Create a new action to decrease the given position.
Sourcepub fn set_swap(self, kind: DecreasePositionSwapType) -> Self
pub fn set_swap(self, kind: DecreasePositionSwapType) -> Self
Set the swap type.
Sourcepub fn is_full_close(&self) -> bool
pub fn is_full_close(&self) -> bool
Whether the action is a full close.
Trait Implementations§
Source§impl<const DECIMALS: u8, P: PositionMut<DECIMALS>> MarketAction for DecreasePosition<P, DECIMALS>
impl<const DECIMALS: u8, P: PositionMut<DECIMALS>> MarketAction for DecreasePosition<P, DECIMALS>
Source§type Report = Box<DecreasePositionReport<<P as PositionState<DECIMALS>>::Num, <P as PositionState<DECIMALS>>::Signed>>
type Report = Box<DecreasePositionReport<<P as PositionState<DECIMALS>>::Num, <P as PositionState<DECIMALS>>::Signed>>
The type of the execution report of the action.
Auto Trait Implementations§
impl<P, const DECIMALS: u8> Freeze for DecreasePosition<P, DECIMALS>
impl<P, const DECIMALS: u8> RefUnwindSafe for DecreasePosition<P, DECIMALS>
impl<P, const DECIMALS: u8> Send for DecreasePosition<P, DECIMALS>
impl<P, const DECIMALS: u8> Sync for DecreasePosition<P, DECIMALS>
impl<P, const DECIMALS: u8> Unpin for DecreasePosition<P, DECIMALS>
impl<P, const DECIMALS: u8> UnwindSafe for DecreasePosition<P, DECIMALS>
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> 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