Skip to main content

Serve

Trait Serve 

Source
pub trait Serve: Sync {
    type Context: Send + Sync + 'static;

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

Server-side handle to a wRPC transport

Invocations are always multiplexed over the wRPC framing layer, so the outgoing and incoming byte streams are the framed Outgoing and Incoming streams regardless of the underlying transport.

Required Associated Types§

Source

type Context: Send + Sync + 'static

Transport-specific invocation context

Required Methods§

Source

fn serve( &self, instance: &str, func: &str, paths: Arc<[Box<[Option<usize>]>]>, ) -> impl Future<Output = Result<impl Stream<Item = Result<(Self::Context, Outgoing, Incoming), Error>> + Send + 'static + use<Self>, Error>> + 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<'a, C, I, O, H> Serve for &'a 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,