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: u32
Heartbeat duration.
precision: u8
Price 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<UpdateTokenConfigParams, TokenConfigError>
pub fn update_price_feed( self, kind: &PriceProviderKind, new_feed: Pubkey, new_timestamp_adjustment: Option<u32>, ) -> Result<UpdateTokenConfigParams, 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) -> UpdateTokenConfigParams
pub fn with_heartbeat_duration(self, duration: u32) -> UpdateTokenConfigParams
Set heartbeat duration.
Sourcepub fn with_precision(self, precision: u8) -> UpdateTokenConfigParams
pub fn with_precision(self, precision: u8) -> UpdateTokenConfigParams
Set precision.
Sourcepub fn with_expected_provider(
self,
provider: PriceProviderKind,
) -> UpdateTokenConfigParams
pub fn with_expected_provider( self, provider: PriceProviderKind, ) -> UpdateTokenConfigParams
Set expected provider.
Trait Implementations§
Source§impl BorshDeserialize for UpdateTokenConfigParams
impl BorshDeserialize for UpdateTokenConfigParams
fn deserialize_reader<R>(
reader: &mut R,
) -> Result<UpdateTokenConfigParams, Error>where
R: Read,
§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 UpdateTokenConfigParams
impl BorshSerialize for UpdateTokenConfigParams
Source§impl Clone for UpdateTokenConfigParams
impl Clone for UpdateTokenConfigParams
Source§fn clone(&self) -> UpdateTokenConfigParams
fn clone(&self) -> UpdateTokenConfigParams
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 UpdateTokenConfigParams
impl Debug for UpdateTokenConfigParams
Source§impl Default for UpdateTokenConfigParams
impl Default for UpdateTokenConfigParams
Source§fn default() -> UpdateTokenConfigParams
fn default() -> UpdateTokenConfigParams
Returns the “default value” for a type. Read more
Source§impl<'a> From<&'a TokenConfig> for UpdateTokenConfigParams
impl<'a> From<&'a TokenConfig> for UpdateTokenConfigParams
Source§fn from(config: &'a TokenConfig) -> UpdateTokenConfigParams
fn from(config: &'a TokenConfig) -> UpdateTokenConfigParams
Converts to this type from the input type.
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
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