Trait wrpc_transport::serve::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

Object Safety§

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,