pub struct MultipartSink<T>{ /* private fields */ }Expand description
The MultipartSink Sink handles sending streams of data to ZeroMQ Sockets.
You shouldn’t ever need to manually create one. Here’s how to get one from a ‘raw’ Socket’
type.
§Example
extern crate zmq;
extern crate futures;
extern crate tokio;
extern crate tokio_zmq;
use std::sync::Arc;
use futures::{Future, Sink};
use tokio_zmq::{prelude::*, Error, Multipart, Pub, Socket};
fn main() {
let context = Arc::new(zmq::Context::new());
let fut = Pub::builder(context)
.bind("tcp://*:5568")
.build()
.and_then(|zpub| {
let sink = zpub.sink(25);
let msg = zmq::Message::from("Some message");
sink.send(msg.into())
});
// tokio::run(fut.map(|_| ()).map_err(|_| ()));
}Implementations§
Trait Implementations§
Source§impl<T> Debug for MultipartSink<T>
impl<T> Debug for MultipartSink<T>
Source§impl<T> Display for MultipartSink<T>
impl<T> Display for MultipartSink<T>
Source§impl<T> IntoSocket<T, Socket> for MultipartSink<T>
impl<T> IntoSocket<T, Socket> for MultipartSink<T>
fn into_socket(self) -> T
Source§impl<T> Sink for MultipartSink<T>
impl<T> Sink for MultipartSink<T>
Source§fn start_send(
&mut self,
multipart: Self::SinkItem,
) -> Result<AsyncSink<Self::SinkItem>, Self::SinkError>
fn start_send( &mut self, multipart: Self::SinkItem, ) -> Result<AsyncSink<Self::SinkItem>, Self::SinkError>
Begin the process of sending a value to the sink. Read more
Source§fn poll_complete(&mut self) -> Result<Async<()>, Self::SinkError>
fn poll_complete(&mut self) -> Result<Async<()>, Self::SinkError>
Flush all output from this sink, if necessary. Read more
Source§fn close(&mut self) -> Result<Async<()>, Self::SinkError>
fn close(&mut self) -> Result<Async<()>, Self::SinkError>
A method to indicate that no more values will ever be pushed into this
sink. Read more
Source§fn wait(self) -> Wait<Self>where
Self: Sized,
fn wait(self) -> Wait<Self>where
Self: Sized,
Creates a new object which will produce a synchronous sink. Read more
Source§fn with<U, F, Fut>(self, f: F) -> With<Self, U, F, Fut>where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = Self::SinkItem>,
<Fut as IntoFuture>::Error: From<Self::SinkError>,
Self: Sized,
fn with<U, F, Fut>(self, f: F) -> With<Self, U, F, Fut>where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = Self::SinkItem>,
<Fut as IntoFuture>::Error: From<Self::SinkError>,
Self: Sized,
Composes a function in front of the sink. Read more
Source§fn with_flat_map<U, F, St>(self, f: F) -> WithFlatMap<Self, U, F, St>
fn with_flat_map<U, F, St>(self, f: F) -> WithFlatMap<Self, U, F, St>
Composes a function in front of the sink. Read more
Source§fn sink_map_err<F, E>(self, f: F) -> SinkMapErr<Self, F>
fn sink_map_err<F, E>(self, f: F) -> SinkMapErr<Self, F>
Transforms the error returned by the sink.
Source§fn sink_from_err<E>(self) -> SinkFromErr<Self, E>
fn sink_from_err<E>(self) -> SinkFromErr<Self, E>
Map this sink’s error to any error implementing
From for this sink’s
Error, returning a new sink. Read moreSource§fn buffer(self, amt: usize) -> Buffer<Self>where
Self: Sized,
fn buffer(self, amt: usize) -> Buffer<Self>where
Self: Sized,
Adds a fixed-size buffer to the current sink. Read more
Source§fn flush(self) -> Flush<Self>where
Self: Sized,
fn flush(self) -> Flush<Self>where
Self: Sized,
A future that completes when the sink has finished processing all
pending requests. Read more
Auto Trait Implementations§
impl<T> !Freeze for MultipartSink<T>
impl<T> !RefUnwindSafe for MultipartSink<T>
impl<T> Send for MultipartSink<T>where
T: Send,
impl<T> !Sync for MultipartSink<T>
impl<T> Unpin for MultipartSink<T>where
T: Unpin,
impl<T> !UnwindSafe for MultipartSink<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more