referrerpolicy=no-referrer-when-downgrade
staging_xcm_builder::test_utils

Trait OnResponse

pub trait OnResponse {
    // Required methods
    fn expecting_response(
        origin: &Location,
        query_id: u64,
        querier: Option<&Location>,
    ) -> bool;
    fn on_response(
        origin: &Location,
        query_id: u64,
        querier: Option<&Location>,
        response: Response,
        max_weight: Weight,
        context: &XcmContext,
    ) -> Weight;
}
Expand description

Define what needs to be done upon receiving a query response.

Required Methods§

fn expecting_response( origin: &Location, query_id: u64, querier: Option<&Location>, ) -> bool

Returns true if we are expecting a response from origin for query query_id that was queried by querier.

fn on_response( origin: &Location, query_id: u64, querier: Option<&Location>, response: Response, max_weight: Weight, context: &XcmContext, ) -> Weight

Handler for receiving a response from origin relating to query_id initiated by querier.

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§

§

impl OnResponse for ()

§

fn expecting_response( _origin: &Location, _query_id: u64, _querier: Option<&Location>, ) -> bool

§

fn on_response( _origin: &Location, _query_id: u64, _querier: Option<&Location>, _response: Response, _max_weight: Weight, _context: &XcmContext, ) -> Weight

Implementors§

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