#[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
Available on crate feature anchor-lang only.
impl BorshDeserialize for DecreasePositionSwapType
Available on crate feature
anchor-lang only.fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§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.
Source§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
Available on crate feature anchor-lang only.
impl BorshSerialize for DecreasePositionSwapType
Available on crate feature
anchor-lang only.Source§impl Clone for DecreasePositionSwapType
impl Clone for DecreasePositionSwapType
Source§fn clone(&self) -> DecreasePositionSwapType
fn clone(&self) -> DecreasePositionSwapType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DecreasePositionSwapType
Source§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
Available on crate feature serde only.
impl<'de> Deserialize<'de> for DecreasePositionSwapType
Available on crate feature
serde only.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
Available on crate feature strum only.
impl Display for DecreasePositionSwapType
Available on crate feature
strum only.Source§impl EnumExt for DecreasePositionSwapType
Available on crate feature anchor-lang only.
impl EnumExt for DecreasePositionSwapType
Available on crate feature
anchor-lang only.impl Eq 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
Available on crate feature strum only.
impl FromStr for DecreasePositionSwapType
Available on crate feature
strum only.Source§impl Hash for DecreasePositionSwapType
impl Hash for DecreasePositionSwapType
Source§impl IntoEnumIterator for DecreasePositionSwapType
Available on crate feature strum only.
impl IntoEnumIterator for DecreasePositionSwapType
Available on crate feature
strum only.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 (const: unstable) · 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
Available on crate feature serde only.
impl Serialize for DecreasePositionSwapType
Available on crate feature
serde only.Source§impl Space for DecreasePositionSwapType
Available on crate feature anchor-lang only.
impl Space for DecreasePositionSwapType
Available on crate feature
anchor-lang only.const INIT_SPACE: usize
impl StructuralPartialEq for DecreasePositionSwapType
Source§impl TryFrom<&str> for DecreasePositionSwapType
Available on crate feature strum only.
impl TryFrom<&str> for DecreasePositionSwapType
Available on crate feature
strum only.Source§impl TryFrom<u8> for DecreasePositionSwapType
impl TryFrom<u8> for DecreasePositionSwapType
Source§type Error = TryFromPrimitiveError<DecreasePositionSwapType>
type Error = TryFromPrimitiveError<DecreasePositionSwapType>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for DecreasePositionSwapType
impl TryFromPrimitive for DecreasePositionSwapType
const NAME: &'static str = "DecreasePositionSwapType"
type Primitive = u8
type Error = TryFromPrimitiveError<DecreasePositionSwapType>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations§
impl Freeze for DecreasePositionSwapType
impl RefUnwindSafe for DecreasePositionSwapType
impl Send for DecreasePositionSwapType
impl Sync for DecreasePositionSwapType
impl Unpin for DecreasePositionSwapType
impl UnsafeUnpin 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