referrerpolicy=no-referrer-when-downgrade

Trait VersionChangeNotifier

Source
pub trait VersionChangeNotifier {
    // Required methods
    fn start(
        location: &Location,
        query_id: QueryId,
        max_weight: Weight,
        context: &XcmContext,
    ) -> XcmResult;
    fn stop(location: &Location, context: &XcmContext) -> XcmResult;
    fn is_subscribed(location: &Location) -> bool;
}
Expand description

Trait for a type which handles notifying a destination of XCM version changes.

Required Methods§

Source

fn start( location: &Location, query_id: QueryId, max_weight: Weight, context: &XcmContext, ) -> XcmResult

Start notifying location should the XCM version of this chain change.

When it does, this type should ensure a QueryResponse message is sent with the given query_id & max_weight and with a response of Response::Version. This should happen until/unless stop is called with the correct query_id.

If the location has an ongoing notification and when this function is called, then an error should be returned.

Source

fn stop(location: &Location, context: &XcmContext) -> XcmResult

Stop notifying location should the XCM change. Returns an error if there is no existing notification set up.

Source

fn is_subscribed(location: &Location) -> bool

Return true if a location is subscribed to XCM version changes.

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 VersionChangeNotifier for ()

Source§

fn start(_: &Location, _: QueryId, _: Weight, _: &XcmContext) -> XcmResult

Source§

fn stop(_: &Location, _: &XcmContext) -> XcmResult

Source§

fn is_subscribed(_: &Location) -> bool

Implementors§