pub trait PythPullOracleOps<C> {
// Required methods
fn pyth(&self) -> &Program<C>;
fn wormhole(&self) -> &Program<C>;
// Provided methods
fn with_pyth_prices<'a, S, It, Fut>(
&'a self,
ctx: &'a PythPullOracleContext,
update: &'a PriceUpdate,
consume: impl FnOnce(Prices) -> Fut,
) -> impl Future<Output = Result<WithPythPrices<'a, C>>>
where C: Deref<Target = S> + Clone + 'a,
S: Signer,
It: IntoIterator<Item = TransactionBuilder<'a, C>>,
Fut: Future<Output = Result<It>> { ... }
fn with_pyth_price_updates<'a, S, It, Fut>(
&'a self,
ctx: &'a PythPullOracleContext,
updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>,
consume: impl FnOnce(Prices) -> Fut,
) -> impl Future<Output = Result<WithPythPrices<'a, C>>>
where C: Deref<Target = S> + Clone + 'a,
S: Signer,
It: IntoIterator<Item = TransactionBuilder<'a, C>>,
Fut: Future<Output = Result<It>> { ... }
fn execute_with_pyth_price_updates<'a, 'exec, T, S>(
&'exec self,
updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>,
execute: &mut T,
compute_unit_price_micro_lamports: Option<u64>,
skip_preflight: bool,
enable_tracing: bool,
) -> impl Future<Output = Result<()>>
where C: Deref<Target = S> + Clone + 'exec,
S: Signer,
T: ExecuteWithPythPrices<'exec, C> { ... }
}
Expand description
Pyth Pull Oracle Ops.
Required Methods§
Provided Methods§
Sourcefn with_pyth_prices<'a, S, It, Fut>(
&'a self,
ctx: &'a PythPullOracleContext,
update: &'a PriceUpdate,
consume: impl FnOnce(Prices) -> Fut,
) -> impl Future<Output = Result<WithPythPrices<'a, C>>>where
C: Deref<Target = S> + Clone + 'a,
S: Signer,
It: IntoIterator<Item = TransactionBuilder<'a, C>>,
Fut: Future<Output = Result<It>>,
fn with_pyth_prices<'a, S, It, Fut>(
&'a self,
ctx: &'a PythPullOracleContext,
update: &'a PriceUpdate,
consume: impl FnOnce(Prices) -> Fut,
) -> impl Future<Output = Result<WithPythPrices<'a, C>>>where
C: Deref<Target = S> + Clone + 'a,
S: Signer,
It: IntoIterator<Item = TransactionBuilder<'a, C>>,
Fut: Future<Output = Result<It>>,
Create transactions to post price updates and consume the prices.
Sourcefn with_pyth_price_updates<'a, S, It, Fut>(
&'a self,
ctx: &'a PythPullOracleContext,
updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>,
consume: impl FnOnce(Prices) -> Fut,
) -> impl Future<Output = Result<WithPythPrices<'a, C>>>where
C: Deref<Target = S> + Clone + 'a,
S: Signer,
It: IntoIterator<Item = TransactionBuilder<'a, C>>,
Fut: Future<Output = Result<It>>,
fn with_pyth_price_updates<'a, S, It, Fut>(
&'a self,
ctx: &'a PythPullOracleContext,
updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>,
consume: impl FnOnce(Prices) -> Fut,
) -> impl Future<Output = Result<WithPythPrices<'a, C>>>where
C: Deref<Target = S> + Clone + 'a,
S: Signer,
It: IntoIterator<Item = TransactionBuilder<'a, C>>,
Fut: Future<Output = Result<It>>,
Create transactions to post price updates and consume the prices.
Sourcefn execute_with_pyth_price_updates<'a, 'exec, T, S>(
&'exec self,
updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>,
execute: &mut T,
compute_unit_price_micro_lamports: Option<u64>,
skip_preflight: bool,
enable_tracing: bool,
) -> impl Future<Output = Result<()>>
fn execute_with_pyth_price_updates<'a, 'exec, T, S>( &'exec self, updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>, execute: &mut T, compute_unit_price_micro_lamports: Option<u64>, skip_preflight: bool, enable_tracing: bool, ) -> impl Future<Output = Result<()>>
Execute with pyth price updates.
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.