pub struct PythOracleConfig {
pub feed_id: [u8; 32],
pub max_age_seconds: u64,
pub max_confidence_bps: u16,
pub price_decimals: u8,
/* private fields */
}Expand description
Pyth pull-oracle configuration stored with the asset it prices.
feed_id is the 32-byte Pyth price feed id expected inside the submitted
price update account. price_decimals is the scale Roshi exposes through
OraclePrice; for example, a Pyth price of 123456789 * 10^-8 with
price_decimals = 8 is returned as 123456789.
max_confidence_bps = 0 disables the confidence-width guardrail.
Fields§
§feed_id: [u8; 32]§max_age_seconds: u64§max_confidence_bps: u16§price_decimals: u8Implementations§
Trait Implementations§
Source§impl Clone for PythOracleConfig
impl Clone for PythOracleConfig
Source§fn clone(&self) -> PythOracleConfig
fn clone(&self) -> PythOracleConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PythOracleConfig
Source§impl Debug for PythOracleConfig
impl Debug for PythOracleConfig
Source§impl Default for PythOracleConfig
impl Default for PythOracleConfig
Source§fn default() -> PythOracleConfig
fn default() -> PythOracleConfig
Returns the “default value” for a type. Read more
impl Eq for PythOracleConfig
Source§impl PartialEq for PythOracleConfig
impl PartialEq for PythOracleConfig
Source§fn eq(&self, other: &PythOracleConfig) -> bool
fn eq(&self, other: &PythOracleConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for PythOracleConfig
impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for PythOracleConfig
type Dst = PythOracleConfig
Source§fn read(
reader: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> ReadResult<()>
fn read( reader: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> ReadResult<()>
Source§impl<WincodeConfig: Config> SchemaWrite<WincodeConfig> for PythOracleConfig
impl<WincodeConfig: Config> SchemaWrite<WincodeConfig> for PythOracleConfig
impl StructuralPartialEq for PythOracleConfig
Source§impl<WincodeConfig: Config> ZeroCopy<WincodeConfig> for PythOracleConfigwhere
for<'_wincode_internal> [u8; 32]: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> u64: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> u16: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> u8: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> [u8; 5]: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> Assert<{ _ }>: IsTrue,
impl<WincodeConfig: Config> ZeroCopy<WincodeConfig> for PythOracleConfigwhere
for<'_wincode_internal> [u8; 32]: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> u64: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> u16: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> u8: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> [u8; 5]: ZeroCopy<WincodeConfig>,
for<'_wincode_internal> Assert<{ _ }>: IsTrue,
Source§fn from_bytes<'de>(bytes: &'de [u8], config: C) -> Result<&'de Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
fn from_bytes<'de>(bytes: &'de [u8], config: C) -> Result<&'de Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
Like
crate::ZeroCopy::from_bytes, but allows the caller to provide a custom configuration.Source§fn from_bytes_mut<'de>(
bytes: &'de mut [u8],
config: C,
) -> Result<&'de mut Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
fn from_bytes_mut<'de>(
bytes: &'de mut [u8],
config: C,
) -> Result<&'de mut Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
Like
crate::ZeroCopy::from_bytes_mut, but allows the caller to provide a custom configuration.Auto Trait Implementations§
impl Freeze for PythOracleConfig
impl RefUnwindSafe for PythOracleConfig
impl Send for PythOracleConfig
impl Sync for PythOracleConfig
impl Unpin for PythOracleConfig
impl UnsafeUnpin for PythOracleConfig
impl UnwindSafe for PythOracleConfig
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<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
Source§impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
Source§impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.Source§impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.impl<T, C> SchemaReadOwned<C> for Twhere
C: ConfigCore,
T: for<'de> SchemaRead<'de, C>,
Source§impl<T> Serialize for T
impl<T> Serialize for T
Source§fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
Serialize a serializable type into a
Vec of bytes.Source§fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
Serialize a serializable type into the given byte buffer.
Source§fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.
Source§impl<T, C> Serialize<C> for T
impl<T, C> Serialize<C> for T
Source§fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
Serialize a serializable type into a
Vec of bytes.Source§fn serialize_into(
dst: impl Writer,
src: &Self::Src,
config: C,
) -> Result<(), WriteError>
fn serialize_into( dst: impl Writer, src: &Self::Src, config: C, ) -> Result<(), WriteError>
Serialize a serializable type into the given
Writer.Source§fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.