#[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: PubkeyMarket token.
index_token_mint: PubkeyIndex token.
long_token_mint: PubkeyLong token.
short_token_mint: PubkeyShort 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>
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 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 duplicate 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 IdlBuild for MarketMeta
impl IdlBuild for MarketMeta
Source§fn create_type() -> Option<IdlTypeDef>
fn create_type() -> Option<IdlTypeDef>
Create an IDL type definition for the type. Read more
Source§fn insert_types(types: &mut BTreeMap<String, IdlTypeDef>)
fn insert_types(types: &mut BTreeMap<String, IdlTypeDef>)
Insert all types that are included in the current type definition to the given map.
Source§fn get_full_path() -> String
fn get_full_path() -> String
Get the full module path of the type. Read more
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§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.Source§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.