Struct jet_margin::Liquidation
source · [−]#[repr(C)]pub struct Liquidation {
pub start_time: i64,
pub equity_change: i128,
pub min_equity_change: i128,
}
Fields
start_time: i64
time that liquidate_begin initialized this liquidation
equity_change: i128
cumulative change in equity caused by invocations during the liquidation so far negative if equity is lost
min_equity_change: i128
lowest amount of equity change that is allowed during invoke steps typically negative or zero if equity_change goes lower than this number, liquidate_invoke should fail
Implementations
sourceimpl Liquidation
impl Liquidation
pub fn new(start_time: i64, min_equity_change: Number128) -> Self
pub fn start_time(&self) -> i64
pub fn equity_change_mut(&mut self) -> &mut Number128
pub fn equity_change(&self) -> &Number128
pub fn min_equity_change(&self) -> Number128
Trait Implementations
sourceimpl BorshDeserialize for Liquidationwhere
i64: BorshDeserialize,
i128: BorshDeserialize,
i128: BorshDeserialize,
impl BorshDeserialize for Liquidationwhere
i64: BorshDeserialize,
i128: BorshDeserialize,
i128: BorshDeserialize,
sourcefn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes. Read more
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
sourceimpl BorshSerialize for Liquidationwhere
i64: BorshSerialize,
i128: BorshSerialize,
i128: BorshSerialize,
impl BorshSerialize for Liquidationwhere
i64: BorshSerialize,
i128: BorshSerialize,
i128: BorshSerialize,
sourceimpl Clone for Liquidation
impl Clone for Liquidation
sourcefn clone(&self) -> Liquidation
fn clone(&self) -> Liquidation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Liquidation
impl Debug for Liquidation
sourceimpl Default for Liquidation
impl Default for Liquidation
sourcefn default() -> Liquidation
fn default() -> Liquidation
Returns the “default value” for a type. Read more
sourceimpl Zeroable for Liquidation
impl Zeroable for Liquidation
impl Copy for Liquidation
impl Pod for Liquidation
Auto Trait Implementations
impl RefUnwindSafe for Liquidation
impl Send for Liquidation
impl Sync for Liquidation
impl Unpin for Liquidation
impl UnwindSafe for Liquidation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
. Read more