Trait common::prelude::DataFeed

source ·
pub trait DataFeed<Symbol, Rate, ResolveTime> {
    // Required methods
    fn quote(symbol: &Symbol) -> Result<Option<Rate>, DispatchError>;
    fn list_enabled_symbols(
        
    ) -> Result<Vec<(Symbol, ResolveTime)>, DispatchError>;
    fn quote_unchecked(symbol: &Symbol) -> Option<Rate>;
}
Expand description

DataFeed trait indicates that particular object could be used for querying oracle data.

Required Methods§

source

fn quote(symbol: &Symbol) -> Result<Option<Rate>, DispatchError>

Get rate for the specified symbol

  • symbol: which symbol to query
source

fn list_enabled_symbols() -> Result<Vec<(Symbol, ResolveTime)>, DispatchError>

Get all supported symbols and their last update time

source

fn quote_unchecked(symbol: &Symbol) -> Option<Rate>

Get rate for the specified symbol without any checks

  • symbol: which symbol to query

Implementations on Foreign Types§

source§

impl<Symbol, Rate, ResolveTime> DataFeed<Symbol, Rate, ResolveTime> for ()

source§

fn quote(_symbol: &Symbol) -> Result<Option<Rate>, DispatchError>

source§

fn list_enabled_symbols() -> Result<Vec<(Symbol, ResolveTime)>, DispatchError>

source§

fn quote_unchecked(_symbol: &Symbol) -> Option<Rate>

Implementors§