Trait Pool

Source
pub trait Pool: Balance + Sized {
    // Required method
    fn checked_apply_delta(&self, delta: Delta<&Self::Signed>) -> Result<Self>;

    // Provided methods
    fn apply_delta_to_long_amount(&mut self, delta: &Self::Signed) -> Result<()> { ... }
    fn apply_delta_to_short_amount(
        &mut self,
        delta: &Self::Signed,
    ) -> Result<()> { ... }
}
Expand description

A balance for holding tokens, usd values, or factors

Required Methods§

Source

fn checked_apply_delta(&self, delta: Delta<&Self::Signed>) -> Result<Self>

Checked apply delta amounts.

Provided Methods§

Source

fn apply_delta_to_long_amount(&mut self, delta: &Self::Signed) -> Result<()>

Apply delta to long amount.

Source

fn apply_delta_to_short_amount(&mut self, delta: &Self::Signed) -> Result<()>

Apply delta to short amount.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§