Skip to main content

Server

Trait Server 

pub trait Server:
    Sized
    + Protocol
    + Send
    + Sync
    + Send
    + Sync {
    // Required method
    fn rpc(
        &mut self,
        context: Context,
        frame: Frame<Self::Request>,
    ) -> impl Future<Output = Result<Frame<Self::Response>, Self::Error>> + Send + Sync;

    // Provided method
    fn version(client_version: Version) -> Result<Version, Error> { ... }
}

Required Methods§

fn rpc( &mut self, context: Context, frame: Frame<Self::Request>, ) -> impl Future<Output = Result<Frame<Self::Response>, Self::Error>> + Send + Sync

The main RPC method that handles incoming requests and produces responses.

Provided Methods§

fn version(client_version: Version) -> Result<Version, Error>

Negotiate the protocol version to use.

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§

§

impl<T> Server for Server<T>
where T: NineP200L + Clone,