#[repr(C)]pub struct TokenConfig { /* private fields */ }
Implementations§
Source§impl TokenConfig
impl TokenConfig
Sourcepub fn get_feed_config(&self, kind: &PriceProviderKind) -> Result<&FeedConfig>
pub fn get_feed_config(&self, kind: &PriceProviderKind) -> Result<&FeedConfig>
Get the corresponding price feed config.
Sourcepub fn set_feed_config(
&mut self,
kind: &PriceProviderKind,
new_config: FeedConfig,
) -> Result<()>
pub fn set_feed_config( &mut self, kind: &PriceProviderKind, new_config: FeedConfig, ) -> Result<()>
Set feed config.
Sourcepub fn get_feed(&self, kind: &PriceProviderKind) -> Result<Pubkey>
pub fn get_feed(&self, kind: &PriceProviderKind) -> Result<Pubkey>
Get the corresponding price feed address.
Sourcepub fn set_expected_provider(&mut self, provider: PriceProviderKind)
pub fn set_expected_provider(&mut self, provider: PriceProviderKind)
Set expected provider.
Sourcepub fn expected_provider(&self) -> Result<PriceProviderKind>
pub fn expected_provider(&self) -> Result<PriceProviderKind>
Get expected price provider kind.
Sourcepub fn get_expected_feed(&self) -> Result<Pubkey>
pub fn get_expected_feed(&self) -> Result<Pubkey>
Get price feed address for the expected provider.
Sourcepub fn set_enabled(&mut self, enable: bool)
pub fn set_enabled(&mut self, enable: bool)
Set enabled.
Sourcepub fn set_synthetic(&mut self, is_synthetic: bool)
pub fn set_synthetic(&mut self, is_synthetic: bool)
Set synthetic.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Is enabled.
Sourcepub fn is_synthetic(&self) -> bool
pub fn is_synthetic(&self) -> bool
Is synthetic.
Sourcepub fn is_valid_pool_token_config(&self) -> bool
pub fn is_valid_pool_token_config(&self) -> bool
Returns whether the config is a valid pool token config.
Sourcepub fn update(
&mut self,
name: &str,
synthetic: bool,
token_decimals: u8,
builder: UpdateTokenConfigParams,
enable: bool,
init: bool,
) -> Result<()>
pub fn update( &mut self, name: &str, synthetic: bool, token_decimals: u8, builder: UpdateTokenConfigParams, enable: bool, init: bool, ) -> Result<()>
Create a new token config from builder.
Sourcepub fn token_decimals(&self) -> u8
pub fn token_decimals(&self) -> u8
Token decimals.
Sourcepub fn timestamp_adjustment(
&self,
price_provider: &PriceProviderKind,
) -> Result<u32>
pub fn timestamp_adjustment( &self, price_provider: &PriceProviderKind, ) -> Result<u32>
Get timestamp adjustment.
Sourcepub fn heartbeat_duration(&self) -> u32
pub fn heartbeat_duration(&self) -> u32
Heartbeat duration.
Trait Implementations§
Source§impl Clone for TokenConfig
impl Clone for TokenConfig
Source§fn clone(&self) -> TokenConfig
fn clone(&self) -> TokenConfig
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 TokenConfig
impl Debug for TokenConfig
Source§impl<'de> Deserialize<'de> for TokenConfig
impl<'de> Deserialize<'de> for TokenConfig
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 TokenConfig
impl Display for TokenConfig
Source§impl<'a> From<&'a TokenConfig> for UpdateTokenConfigParams
impl<'a> From<&'a TokenConfig> for UpdateTokenConfigParams
Source§fn from(config: &'a TokenConfig) -> Self
fn from(config: &'a TokenConfig) -> Self
Converts to this type from the input type.
Source§impl InitSpace for TokenConfig
impl InitSpace for TokenConfig
Source§const INIT_SPACE: usize = 328usize
const INIT_SPACE: usize = 328usize
Init Space.
Source§impl PartialEq for TokenConfig
impl PartialEq for TokenConfig
Source§impl Serialize for TokenConfig
impl Serialize for TokenConfig
impl Copy for TokenConfig
impl Eq for TokenConfig
impl Pod for TokenConfig
impl StructuralPartialEq for TokenConfig
Auto Trait Implementations§
impl Freeze for TokenConfig
impl RefUnwindSafe for TokenConfig
impl Send for TokenConfig
impl Sync for TokenConfig
impl Unpin for TokenConfig
impl UnwindSafe for TokenConfig
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,
§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