Trait InnerSocket

Source
pub trait InnerSocket<T>: Sized
where T: IntoInnerSocket + From<Self>,
{ type Request: Future<Item = T>; type Response: Future<Item = (Multipart, T)>; type Stream: Stream<Item = Multipart> + IntoSocket<T, Self>; type Sink: Sink<SinkItem = Multipart> + IntoSocket<T, Self>; type SinkStream: Stream<Item = Multipart> + Sink<SinkItem = Multipart> + IntoSocket<T, Self>; // Required methods fn send(self, multipart: Multipart) -> Self::Request; fn recv(self) -> Self::Response; fn stream(self) -> Self::Stream; fn sink(self, buffer_size: usize) -> Self::Sink; fn sink_stream(self, buffer_size: usize) -> Self::SinkStream; }
Expand description

Define all actions possible on a socket

This should be generic enough to implement over any executor. On Tokio, this might consist of a Socket with an EventedFd, on Futures, it might just be a Socket.

Required Associated Types§

Source

type Request: Future<Item = T>

The future that sends a multipart to a ZMQ socket

Source

type Response: Future<Item = (Multipart, T)>

The future that receives a multipart from a ZMQ socket

Source

type Stream: Stream<Item = Multipart> + IntoSocket<T, Self>

A Stream of multiparts received from a ZMQ socket

Source

type Sink: Sink<SinkItem = Multipart> + IntoSocket<T, Self>

A Sink that sends multiparts to a ZMQ socket

Source

type SinkStream: Stream<Item = Multipart> + Sink<SinkItem = Multipart> + IntoSocket<T, Self>

A Sink and Stream that sends and receives multiparts from a ZMQ socket

Required Methods§

Source

fn send(self, multipart: Multipart) -> Self::Request

Source

fn recv(self) -> Self::Response

Source

fn stream(self) -> Self::Stream

Source

fn sink(self, buffer_size: usize) -> Self::Sink

Source

fn sink_stream(self, buffer_size: usize) -> Self::SinkStream

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§