Skip to main content

FnRemote

Trait FnRemote 

Source
pub trait FnRemote:
    MsgId
    + Serialize
    + DeserializeOwned
    + Debug {
    type Output: Serialize + DeserializeOwned + Debug;

    // Provided methods
    fn call<'life0, 'async_trait, C>(
        self,
        connection: &'life0 C,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, C::Error>> + 'async_trait>>
       where C: RpcClient + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn begin_call<'life0, 'async_trait, C>(
        self,
        connection: &'life0 C,
    ) -> Pin<Box<dyn Future<Output = Result<C::Call<Self::Output>, C::Error>> + 'async_trait>>
       where C: ConcurrentRpcClient + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A remote procedure.

This defines the signature of an RPC call, which can then be used by the client or the server. The data items in the implementor are the parameters to the remote call.

Required Associated Types§

Source

type Output: Serialize + DeserializeOwned + Debug

The return type.

Provided Methods§

Source

fn call<'life0, 'async_trait, C>( self, connection: &'life0 C, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, C::Error>> + 'async_trait>>
where C: RpcClient + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Allow function.call(connection) instead of connection.call(function).

The default implementation defers to RpcClient::call. You shouldn’t need to implement this.

Source

fn begin_call<'life0, 'async_trait, C>( self, connection: &'life0 C, ) -> Pin<Box<dyn Future<Output = Result<C::Call<Self::Output>, C::Error>> + 'async_trait>>
where C: ConcurrentRpcClient + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Allow function.call(connection) instead of connection.call(function).

The default implementation defers to ConcurrentRpcClient::begin_call. You shouldn’t need to implement this.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§