Trait Method

Source
pub trait Method: DynMethod {
    type Output: Send + 'static;
    type Update: Send + 'static;
}
Expand description

A typed method, used to ensure that all implementations of a method have the same success and updates types.

Prefer to implement this trait or RpcMethod, rather than DynMethod or DeserMethod. (Those traits represent a type-erased method, with statically-unknown Output and Update types.)

All Methods can be invoked via DispatchTable::invoke_special. To be invoked from the RPC system, a methods associated Output and Update types must additionally implement Serialize, and its Error type must implement Into<RpcError>

Required Associated Types§

Source

type Output: Send + 'static

A type returned by this method.

Source

type Update: Send + 'static

A type sent by this method on updates.

If this method will never send updates, use the uninhabited NoUpdates type.

Implementors§