referrerpolicy=no-referrer-when-downgrade
staging_xcm_executor::traits

Trait QueryHandler

Source
pub trait QueryHandler {
    type BlockNumber: Zero + Encode;
    type Error;
    type UniversalLocation: Get<InteriorLocation>;

    // Required methods
    fn new_query(
        responder: impl Into<Location>,
        timeout: Self::BlockNumber,
        match_querier: impl Into<Location>,
    ) -> QueryId;
    fn report_outcome(
        message: &mut Xcm<()>,
        responder: impl Into<Location>,
        timeout: Self::BlockNumber,
    ) -> Result<QueryId, Self::Error>;
    fn take_response(id: QueryId) -> QueryResponseStatus<Self::BlockNumber>;
    fn expect_response(id: QueryId, response: Response);
}
Expand description

Provides methods to expect responses from XCMs and query their status.

Required Associated Types§

Source

type BlockNumber: Zero + Encode

Source

type Error

Source

type UniversalLocation: Get<InteriorLocation>

Required Methods§

Source

fn new_query( responder: impl Into<Location>, timeout: Self::BlockNumber, match_querier: impl Into<Location>, ) -> QueryId

Attempt to create a new query ID and register it as a query that is yet to respond.

Source

fn report_outcome( message: &mut Xcm<()>, responder: impl Into<Location>, timeout: Self::BlockNumber, ) -> Result<QueryId, Self::Error>

Consume message and return another which is equivalent to it except that it reports back the outcome.

  • message: The message whose outcome should be reported.
  • responder: The origin from which a response should be expected.
  • timeout: The block number after which it is permissible to return NotFound from take_response.

report_outcome may return an error if the responder is not invertible.

It is assumed that the querier of the response will be Here. The response can be queried with take_response.

Source

fn take_response(id: QueryId) -> QueryResponseStatus<Self::BlockNumber>

Attempt to remove and return the response of query with ID query_id.

Source

fn expect_response(id: QueryId, response: Response)

Makes sure to expect a response with the given id.

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.

Implementations on Foreign Types§

Source§

impl QueryHandler for ()

Source§

type BlockNumber = u64

Source§

type Error = ()

Source§

type UniversalLocation = UniversalLocation

Source§

fn take_response(_query_id: QueryId) -> QueryResponseStatus<Self::BlockNumber>

Source§

fn new_query( _responder: impl Into<Location>, _timeout: Self::BlockNumber, _match_querier: impl Into<Location>, ) -> QueryId

Source§

fn report_outcome( _message: &mut Xcm<()>, _responder: impl Into<Location>, _timeout: Self::BlockNumber, ) -> Result<QueryId, Self::Error>

Source§

fn expect_response(_id: QueryId, _response: Response)

Implementors§

impl<T: Config> QueryHandler for Pallet<T>