pub trait TokenMapAccess {
// Required method
fn get(&self, token: &Pubkey) -> Option<&TokenConfig>;
// Provided methods
fn token_configs_for_market(
&self,
market: &impl HasMarketMeta,
) -> Option<[&TokenConfig; 3]> { ... }
fn sort_tokens_by_provider(&self, tokens: &mut [Pubkey]) -> Result<()> { ... }
}
Expand description
Read Token Map.
Required Methods§
Sourcefn get(&self, token: &Pubkey) -> Option<&TokenConfig>
fn get(&self, token: &Pubkey) -> Option<&TokenConfig>
Get the config of the given token.
Provided Methods§
Sourcefn token_configs_for_market(
&self,
market: &impl HasMarketMeta,
) -> Option<[&TokenConfig; 3]>
fn token_configs_for_market( &self, market: &impl HasMarketMeta, ) -> Option<[&TokenConfig; 3]>
Get token configs for the given market.
Returns the token configs for index_token
, long_token
and short_token
.
Sourcefn sort_tokens_by_provider(&self, tokens: &mut [Pubkey]) -> Result<()>
fn sort_tokens_by_provider(&self, tokens: &mut [Pubkey]) -> Result<()>
Sort tokens by provider. This sort is stable.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.