wrpc_transport::frame

Trait Accept

Source
pub trait Accept {
    type Context: Send + Sync + 'static;
    type Outgoing: AsyncWrite + Send + Sync + Unpin + 'static;
    type Incoming: AsyncRead + Send + Sync + Unpin + 'static;

    // Required method
    fn accept(
        &self,
    ) -> impl Future<Output = Result<(Self::Context, Self::Outgoing, Self::Incoming)>>;
}
Expand description

Accepts connections on a transport

Required Associated Types§

Source

type Context: Send + Sync + 'static

Transport-specific invocation context

Source

type Outgoing: AsyncWrite + Send + Sync + Unpin + 'static

Outgoing byte stream

Source

type Incoming: AsyncRead + Send + Sync + Unpin + 'static

Incoming byte stream

Required Methods§

Source

fn accept( &self, ) -> impl Future<Output = Result<(Self::Context, Self::Outgoing, Self::Incoming)>>

Accept a connection returning a pair of streams and connection context

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<T, U, F> Accept for &AcceptMapContext<T, F>
where T: Accept, U: Send + Sync + 'static, F: Fn(T::Context) -> U,

Source§

impl<T, U, F> Accept for AcceptMapContext<T, F>
where T: Accept, U: Send + Sync + 'static, F: Fn(T::Context) -> U,