Trait ibc_chain_registry::querier::QueryContext
source · pub trait QueryContext: QueryTypes {
// Required methods
fn query_error(chain_name: String) -> Self::QueryError;
fn query<'async_trait>(
url: Self::QueryInput,
) -> Pin<Box<dyn Future<Output = Result<Self::QueryOutput, Self::QueryError>> + Send + 'async_trait>>
where Self: 'async_trait;
// Provided method
fn query_healthy<'async_trait>(
chain_name: String,
urls: Vec<Self::QueryInput>,
) -> Pin<Box<dyn Future<Output = Result<Self::QueryOutput, Self::QueryError>> + Send + 'async_trait>>
where Self: Send + 'async_trait { ... }
}Expand description
QueryContext represents the basic expectations for a query
Required Methods§
sourcefn query_error(chain_name: String) -> Self::QueryError
fn query_error(chain_name: String) -> Self::QueryError
Return an error specific to the query which is returned when query_healthy fails
§Arguments
chain_name- A string slice that holds the name of a chain
sourcefn query<'async_trait>(
url: Self::QueryInput,
) -> Pin<Box<dyn Future<Output = Result<Self::QueryOutput, Self::QueryError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn query<'async_trait>(
url: Self::QueryInput,
) -> Pin<Box<dyn Future<Output = Result<Self::QueryOutput, Self::QueryError>> + Send + 'async_trait>>where
Self: 'async_trait,
Query an endpoint and return the result
§Arguments
url- AQueryInputobject that holds the data needed to query a node
Provided Methods§
sourcefn query_healthy<'async_trait>(
chain_name: String,
urls: Vec<Self::QueryInput>,
) -> Pin<Box<dyn Future<Output = Result<Self::QueryOutput, Self::QueryError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
fn query_healthy<'async_trait>(
chain_name: String,
urls: Vec<Self::QueryInput>,
) -> Pin<Box<dyn Future<Output = Result<Self::QueryOutput, Self::QueryError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
Query every endpoint from a list of urls and return the output of the first one to answer.
§Arguments
chain_name- A string that holds the name of a chainurls- A vector of urls to query
Object Safety§
This trait is not object safe.