pub struct UpdateTokenConfigParams {
pub heartbeat_duration: u32,
pub precision: u8,
pub feeds: Vec<Pubkey>,
pub timestamp_adjustments: Vec<u32>,
pub expected_provider: Option<u8>,
}Fields§
§heartbeat_duration: u32Heartbeat duration.
precision: u8Price precision.
feeds: Vec<Pubkey>Feeds.
timestamp_adjustments: Vec<u32>Timestamp adjustments.
expected_provider: Option<u8>Expected price provider.
Implementations§
Source§impl UpdateTokenConfigParams
impl UpdateTokenConfigParams
Sourcepub fn update_price_feed(
self,
kind: &PriceProviderKind,
new_feed: Pubkey,
new_timestamp_adjustment: Option<u32>,
) -> Result<Self, TokenConfigError>
pub fn update_price_feed( self, kind: &PriceProviderKind, new_feed: Pubkey, new_timestamp_adjustment: Option<u32>, ) -> Result<Self, TokenConfigError>
Update the feed address for the given price provider. Return error when the feed was not set before.
Sourcepub fn with_heartbeat_duration(self, duration: u32) -> Self
pub fn with_heartbeat_duration(self, duration: u32) -> Self
Set heartbeat duration.
Sourcepub fn with_precision(self, precision: u8) -> Self
pub fn with_precision(self, precision: u8) -> Self
Set precision.
Sourcepub fn with_expected_provider(self, provider: PriceProviderKind) -> Self
pub fn with_expected_provider(self, provider: PriceProviderKind) -> Self
Set expected provider.
Trait Implementations§
Source§impl BorshDeserialize for UpdateTokenConfigParamswhere
u32: BorshDeserialize,
u8: BorshDeserialize,
Vec<Pubkey>: BorshDeserialize,
Vec<u32>: BorshDeserialize,
Option<u8>: BorshDeserialize,
impl BorshDeserialize for UpdateTokenConfigParamswhere
u32: BorshDeserialize,
u8: BorshDeserialize,
Vec<Pubkey>: BorshDeserialize,
Vec<u32>: BorshDeserialize,
Option<u8>: 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 UpdateTokenConfigParamswhere
u32: BorshSerialize,
u8: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
Vec<u32>: BorshSerialize,
Option<u8>: BorshSerialize,
impl BorshSerialize for UpdateTokenConfigParamswhere
u32: BorshSerialize,
u8: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
Vec<u32>: BorshSerialize,
Option<u8>: BorshSerialize,
Source§impl Clone for UpdateTokenConfigParams
impl Clone for UpdateTokenConfigParams
Source§fn clone(&self) -> UpdateTokenConfigParams
fn clone(&self) -> UpdateTokenConfigParams
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 UpdateTokenConfigParams
impl Debug for UpdateTokenConfigParams
Source§impl Default for UpdateTokenConfigParams
impl Default for UpdateTokenConfigParams
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 IdlBuild for UpdateTokenConfigParams
impl IdlBuild for UpdateTokenConfigParams
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
Auto Trait Implementations§
impl Freeze for UpdateTokenConfigParams
impl RefUnwindSafe for UpdateTokenConfigParams
impl Send for UpdateTokenConfigParams
impl Sync for UpdateTokenConfigParams
impl Unpin for UpdateTokenConfigParams
impl UnwindSafe for UpdateTokenConfigParams
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