#[repr(C)]pub struct MarketMeta {
pub market_token_mint: Pubkey,
pub index_token_mint: Pubkey,
pub long_token_mint: Pubkey,
pub short_token_mint: Pubkey,
}
Expand description
Market Metadata.
Fields§
§market_token_mint: Pubkey
Market token.
index_token_mint: Pubkey
Index token.
long_token_mint: Pubkey
Long token.
short_token_mint: Pubkey
Short token.
Implementations§
Source§impl MarketMeta
impl MarketMeta
Sourcepub fn is_collateral_token(&self, token: &Pubkey) -> bool
pub fn is_collateral_token(&self, token: &Pubkey) -> bool
Check if the given token is a valid collateral token.
Sourcepub fn to_token_side(&self, token: &Pubkey) -> Result<bool, MarketError>
pub fn to_token_side(&self, token: &Pubkey) -> Result<bool, MarketError>
Check if the given token is long token or short token, and return it’s side.
Sourcepub fn opposite_token(&self, token: &Pubkey) -> Result<&Pubkey, MarketError>
pub fn opposite_token(&self, token: &Pubkey) -> Result<&Pubkey, MarketError>
Get opposite token.
Sourcepub fn ordered_tokens(&self) -> BTreeSet<Pubkey>
pub fn ordered_tokens(&self) -> BTreeSet<Pubkey>
Get ordered token set.
Trait Implementations§
Source§impl BorshDeserialize for MarketMetawhere
Pubkey: BorshDeserialize,
impl BorshDeserialize for MarketMetawhere
Pubkey: BorshDeserialize,
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 MarketMetawhere
Pubkey: BorshSerialize,
impl BorshSerialize for MarketMetawhere
Pubkey: BorshSerialize,
Source§impl Clone for MarketMeta
impl Clone for MarketMeta
Source§fn clone(&self) -> MarketMeta
fn clone(&self) -> MarketMeta
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 MarketMeta
impl Debug for MarketMeta
Source§impl<'de> Deserialize<'de> for MarketMeta
impl<'de> Deserialize<'de> for MarketMeta
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 HasMarketMeta for MarketMeta
impl HasMarketMeta for MarketMeta
fn market_meta(&self) -> &MarketMeta
fn is_pure(&self) -> bool
Source§impl Serialize for MarketMeta
impl Serialize for MarketMeta
impl Copy for MarketMeta
impl Pod for MarketMeta
Auto Trait Implementations§
impl Freeze for MarketMeta
impl RefUnwindSafe for MarketMeta
impl Send for MarketMeta
impl Sync for MarketMeta
impl Unpin for MarketMeta
impl UnwindSafe for MarketMeta
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
§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
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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