MethodHandler

Trait MethodHandler 

Source
pub trait MethodHandler: Sized + 'static {
    // Required method
    fn on_method_call(&self, call: MethodCall, reply: MethodCallReply);

    // Provided methods
    fn assign_weak_self(&self, _weak_self: Weak<Self>) { ... }
    fn assign_invoker(&self, _invoker: MethodInvoker) { ... }
    fn on_isolate_destroyed(&self, _isolate: IsolateId) { ... }
    fn register(self, channel: &str) -> RegisteredMethodHandler<Self> { ... }
}

Required Methods§

Provided Methods§

Source

fn assign_weak_self(&self, _weak_self: Weak<Self>)

Implementation can store weak reference if it needs to pass it around. Guaranteed to be called before any other methods.

Source

fn assign_invoker(&self, _invoker: MethodInvoker)

Keep the method invoker if you want to call methods on engines.

Source

fn on_isolate_destroyed(&self, _isolate: IsolateId)

Called when isolate is about to be destroyed.

Source

fn register(self, channel: &str) -> RegisteredMethodHandler<Self>

Register self for handling platform channel methods.

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.

Implementors§