Enum jet_margin::PositionChange
source · [−]pub enum PositionChange {
Price(PriceChangeInfo),
Flags(AdapterPositionFlags, bool),
Register(Pubkey),
Close(Pubkey),
}
Variants
Price(PriceChangeInfo)
The price/value of the position has already changed, so the margin account must update its price
Flags(AdapterPositionFlags, bool)
Flags that are true here will be set to the bool in the position Flags that are false here will be unchanged in the position
Register(Pubkey)
Register a new position, or assert that a position is registered if the position cannot be registered, instruction fails if the position is already registered, instruction succeeds without taking action
Close(Pubkey)
Close a position, or assert that a position is closed if the position cannot be closed, instruction fails if the position does not exist, instruction succeeds without taking action
Trait Implementations
sourceimpl BorshDeserialize for PositionChangewhere
PriceChangeInfo: BorshDeserialize,
AdapterPositionFlags: BorshDeserialize,
bool: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
impl BorshDeserialize for PositionChangewhere
PriceChangeInfo: BorshDeserialize,
AdapterPositionFlags: BorshDeserialize,
bool: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: 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 PositionChangewhere
PriceChangeInfo: BorshSerialize,
AdapterPositionFlags: BorshSerialize,
bool: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
impl BorshSerialize for PositionChangewhere
PriceChangeInfo: BorshSerialize,
AdapterPositionFlags: BorshSerialize,
bool: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
sourceimpl Clone for PositionChange
impl Clone for PositionChange
sourcefn clone(&self) -> PositionChange
fn clone(&self) -> PositionChange
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 moreAuto Trait Implementations
impl RefUnwindSafe for PositionChange
impl Send for PositionChange
impl Sync for PositionChange
impl Unpin for PositionChange
impl UnwindSafe for PositionChange
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