Skip to main content

CSTraitServer

Trait CSTraitServer 

Source
pub trait CSTraitServer: Send {
    // Required method
    fn start<S: Clone + Send + Sync + 'static, Request: for<'a> Deserialize<'a> + Send + 'static, Response: Serialize + Send + 'static, Fut: Future<Output = Option<Response>> + Send + 'static, F: Fn(S, Request) -> Fut + Send + Sync + Clone + 'static>(
        self,
        shared: S,
        on_request: F,
        exit: Receiver<()>,
    ) -> (SocketAddr, Pin<Box<dyn Future<Output = ()> + Send>>);
}

Required Methods§

Source

fn start<S: Clone + Send + Sync + 'static, Request: for<'a> Deserialize<'a> + Send + 'static, Response: Serialize + Send + 'static, Fut: Future<Output = Option<Response>> + Send + 'static, F: Fn(S, Request) -> Fut + Send + Sync + Clone + 'static>( self, shared: S, on_request: F, exit: Receiver<()>, ) -> (SocketAddr, Pin<Box<dyn Future<Output = ()> + Send>>)

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§