pub trait QueryController<Origin, Timeout>: QueryHandler {
type WeightInfo: QueryControllerWeightInfo;
// Required method
fn query(
origin: Origin,
timeout: Timeout,
match_querier: VersionedLocation,
) -> Result<QueryId, DispatchError>;
}
Expand description
Query a remote location, from a given origin.
An implementation of that trait will handle the low-level details of querying a remote location, such as:
- Validating and Converting the origin to an interior location.
- Handling versioning.
- Calling the
QueryHandler
to register the query.
Required Associated Types§
Sourcetype WeightInfo: QueryControllerWeightInfo
type WeightInfo: QueryControllerWeightInfo
Weight information for QueryController functions.
Required Methods§
Sourcefn query(
origin: Origin,
timeout: Timeout,
match_querier: VersionedLocation,
) -> Result<QueryId, DispatchError>
fn query( origin: Origin, timeout: Timeout, match_querier: VersionedLocation, ) -> Result<QueryId, DispatchError>
Query a remote location.
§Parameters
origin
: the origin of the call, used to determine the responder.timeout
: the maximum block number that the query should be responded to.match_querier
: the querier that the query should be responded to.
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.