wrpc_transport::serve

Trait Serve

Source
pub trait Serve: Sync {
    type Context: Send + Sync + 'static;
    type Outgoing: AsyncWrite + Index<Self::Outgoing> + Send + Sync + Unpin + 'static;
    type Incoming: AsyncRead + Index<Self::Incoming> + Send + Sync + Unpin + 'static;

    // Required method
    fn serve(
        &self,
        instance: &str,
        func: &str,
        paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send,
    ) -> impl Future<Output = Result<impl Stream<Item = Result<(Self::Context, Self::Outgoing, Self::Incoming)>> + Send + 'static>> + Send;
}
Expand description

Server-side handle to a wRPC transport

Required Associated Types§

Source

type Context: Send + Sync + 'static

Transport-specific invocation context

Source

type Outgoing: AsyncWrite + Index<Self::Outgoing> + Send + Sync + Unpin + 'static

Outgoing multiplexed byte stream

Source

type Incoming: AsyncRead + Index<Self::Incoming> + Send + Sync + Unpin + 'static

Incoming multiplexed byte stream

Required Methods§

Source

fn serve( &self, instance: &str, func: &str, paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send, ) -> impl Future<Output = Result<impl Stream<Item = Result<(Self::Context, Self::Outgoing, Self::Incoming)>> + Send + 'static>> + Send

Serve function func from instance instance

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§

Source§

impl<C, I, O, H> Serve for &Server<C, I, O, H>
where C: Send + Sync + 'static, I: AsyncRead + Send + Sync + Unpin + 'static, O: AsyncWrite + Send + Sync + Unpin + 'static, H: ConnHandler<I, O> + Send + Sync,

Source§

impl<C, I, O, H> Serve for Server<C, I, O, H>
where C: Send + Sync + 'static, I: AsyncRead + Send + Sync + Unpin + 'static, O: AsyncWrite + Send + Sync + Unpin + 'static, H: ConnHandler<I, O> + Send + Sync,

impl Serve for WrpcClient

impl Serve for Client