Trait TransportChannel

Source
pub trait TransportChannel: 'static {
    type SinkError: Error + 'static + Sync + Send;
    type StreamError: Error + 'static + Sync + Send;
    type Input: Stream<Item = TransportInput<Self::StreamError>> + Unpin + Send + 'static;
    type Output: Sink<RPCData, Error = Self::SinkError> + Unpin + Send + 'static;

    // Required methods
    fn spawn<Fut>(future: Fut)
       where Fut: Future<Output = RPCResult<()>> + Send + 'static;
    fn framed(self) -> (Self::Input, Self::Output);
}
Expand description

Define abstract transport channel for crate::Client and crate::Server

Required Associated Types§

Source

type SinkError: Error + 'static + Sync + Send

Transport channel error type.

Source

type StreamError: Error + 'static + Sync + Send

Source

type Input: Stream<Item = TransportInput<Self::StreamError>> + Unpin + Send + 'static

Input stream must support Send + Sync

Source

type Output: Sink<RPCData, Error = Self::SinkError> + Unpin + Send + 'static

Required Methods§

Source

fn spawn<Fut>(future: Fut)
where Fut: Future<Output = RPCResult<()>> + Send + 'static,

Source

fn framed(self) -> (Self::Input, Self::Output)

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§