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§
sourcefn quote(symbol: &Symbol) -> Result<Option<Rate>, DispatchError>
fn quote(symbol: &Symbol) -> Result<Option<Rate>, DispatchError>
Get rate for the specified symbol
symbol
: which symbol to query
sourcefn list_enabled_symbols() -> Result<Vec<(Symbol, ResolveTime)>, DispatchError>
fn list_enabled_symbols() -> Result<Vec<(Symbol, ResolveTime)>, DispatchError>
Get all supported symbols and their last update time
sourcefn quote_unchecked(symbol: &Symbol) -> Option<Rate>
fn quote_unchecked(symbol: &Symbol) -> Option<Rate>
Get rate for the specified symbol without any checks
symbol
: which symbol to query