#[non_exhaustive]#[repr(u8)]pub enum DecreasePositionSwapType {
NoSwap = 0,
PnlTokenToCollateralToken = 1,
CollateralToPnlToken = 2,
}
Expand description
Swap Type for the decrease position action.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoSwap = 0
No swap.
PnlTokenToCollateralToken = 1
Swap PnL token to collateral token.
CollateralToPnlToken = 2
Swap collateral token to PnL token.
Trait Implementations§
Source§impl BorshDeserialize for DecreasePositionSwapType
impl BorshDeserialize for DecreasePositionSwapType
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
§fn 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.
§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.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for DecreasePositionSwapType
impl BorshSerialize for DecreasePositionSwapType
Source§impl Clone for DecreasePositionSwapType
impl Clone for DecreasePositionSwapType
Source§fn clone(&self) -> DecreasePositionSwapType
fn clone(&self) -> DecreasePositionSwapType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DecreasePositionSwapType
impl Debug for DecreasePositionSwapType
Source§impl Default for DecreasePositionSwapType
impl Default for DecreasePositionSwapType
Source§fn default() -> DecreasePositionSwapType
fn default() -> DecreasePositionSwapType
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DecreasePositionSwapType
impl<'de> Deserialize<'de> for DecreasePositionSwapType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DecreasePositionSwapType
impl Display for DecreasePositionSwapType
Source§impl EnumExt for DecreasePositionSwapType
impl EnumExt for DecreasePositionSwapType
Source§impl From<DecreasePositionSwapType> for u8
impl From<DecreasePositionSwapType> for u8
Source§fn from(enum_value: DecreasePositionSwapType) -> Self
fn from(enum_value: DecreasePositionSwapType) -> Self
Converts to this type from the input type.
Source§impl FromStr for DecreasePositionSwapType
impl FromStr for DecreasePositionSwapType
Source§impl Hash for DecreasePositionSwapType
impl Hash for DecreasePositionSwapType
Source§impl IntoEnumIterator for DecreasePositionSwapType
impl IntoEnumIterator for DecreasePositionSwapType
Source§impl Ord for DecreasePositionSwapType
impl Ord for DecreasePositionSwapType
Source§fn cmp(&self, other: &DecreasePositionSwapType) -> Ordering
fn cmp(&self, other: &DecreasePositionSwapType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DecreasePositionSwapType
impl PartialEq for DecreasePositionSwapType
Source§impl PartialOrd for DecreasePositionSwapType
impl PartialOrd for DecreasePositionSwapType
Source§impl Serialize for DecreasePositionSwapType
impl Serialize for DecreasePositionSwapType
Source§impl Space for DecreasePositionSwapType
impl Space for DecreasePositionSwapType
const INIT_SPACE: usize = 1usize
Source§impl TryFrom<&str> for DecreasePositionSwapType
impl TryFrom<&str> for DecreasePositionSwapType
Source§impl TryFrom<u8> for DecreasePositionSwapType
impl TryFrom<u8> for DecreasePositionSwapType
Source§impl TryFromPrimitive for DecreasePositionSwapType
impl TryFromPrimitive for DecreasePositionSwapType
impl Copy for DecreasePositionSwapType
impl Eq for DecreasePositionSwapType
impl StructuralPartialEq for DecreasePositionSwapType
Auto Trait Implementations§
impl Freeze for DecreasePositionSwapType
impl RefUnwindSafe for DecreasePositionSwapType
impl Send for DecreasePositionSwapType
impl Sync for DecreasePositionSwapType
impl Unpin for DecreasePositionSwapType
impl UnwindSafe for DecreasePositionSwapType
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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