pub struct Merged<A, B>(/* private fields */);
Expand description
Merged balanced pool.
A Balance
returned by BalanceExt::merge
.
Trait Implementations§
Source§impl<A, B, Num, Signed> Balance for Merged<A, B>
impl<A, B, Num, Signed> Balance for Merged<A, B>
Source§fn long_amount(&self) -> Result<Self::Num>
fn long_amount(&self) -> Result<Self::Num>
Get the long token amount (when this is a token balance), or long usd value (when this is a usd value balance).
Source§fn short_amount(&self) -> Result<Self::Num>
fn short_amount(&self) -> Result<Self::Num>
Get the short token amount (when this is a token balance), or short usd value (when this is a usd value balance).
impl<A: Copy, B: Copy> Copy for Merged<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for Merged<A, B>
impl<A, B> RefUnwindSafe for Merged<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Merged<A, B>
impl<A, B> Sync for Merged<A, B>
impl<A, B> Unpin for Merged<A, B>
impl<A, B> UnwindSafe for Merged<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<P> BalanceExt for P
impl<P> BalanceExt for P
Source§fn long_usd_value(&self, price: &Self::Num) -> Result<Self::Num>
fn long_usd_value(&self, price: &Self::Num) -> Result<Self::Num>
Get the long amount value in USD.
Source§fn short_usd_value(&self, price: &Self::Num) -> Result<Self::Num>
fn short_usd_value(&self, price: &Self::Num) -> Result<Self::Num>
Get the short amount value in USD.
Source§fn pool_delta_with_amounts(
&self,
long_token_delta_amount: &Self::Signed,
short_token_delta_amount: &Self::Signed,
long_token_price: &Self::Num,
short_token_price: &Self::Num,
) -> Result<PoolDelta<Self::Num>>
fn pool_delta_with_amounts( &self, long_token_delta_amount: &Self::Signed, short_token_delta_amount: &Self::Signed, long_token_price: &Self::Num, short_token_price: &Self::Num, ) -> Result<PoolDelta<Self::Num>>
Get pool value information after applying delta.
Source§fn pool_delta_with_values(
&self,
delta_long_token_usd_value: Self::Signed,
delta_short_token_usd_value: Self::Signed,
long_token_price: &Self::Num,
short_token_price: &Self::Num,
) -> Result<PoolDelta<Self::Num>>
fn pool_delta_with_values( &self, delta_long_token_usd_value: Self::Signed, delta_short_token_usd_value: Self::Signed, long_token_price: &Self::Num, short_token_price: &Self::Num, ) -> Result<PoolDelta<Self::Num>>
Get pool value information after applying delta.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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