Struct multi_producer_sink::SyncMPS [] [src]

pub struct SyncMPS<S: Sink> { /* fields omitted */ }

A multi producer sink (SyncMPS). This is a cloneable handle to a single sink of type S, and each handle can be used to write to the inner sink.

An error is signaled via the Done, the sink methods themselves only return Err(()). Upon encountering an error, all handles are notified and they return Err(()). All further polling will always yield Err(None) as well.

Unless an error occured, each of the handles must invoke close before being dropped. The inner sink is closed when each of the handles has closed and emitted via the Done.

Trait Implementations

impl<S: Sink> Drop for SyncMPS<S>
[src]

Performs minimal cleanup to allow for correct closing behaviour

[src]

Executes the destructor for this type. Read more

impl<S: Sink> Clone for SyncMPS<S>
[src]

[src]

Returns a new handle to the same underlying sink.

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S: Sink> Sink for SyncMPS<S>
[src]

The type of value that the sink accepts.

The type of value produced by the sink when an error occurs.

[src]

Attempts to prepare the Sink to receive a value. Read more

[src]

Begin the process of sending a value to the sink. Each call to this function must be proceeded by a successful call to poll_ready which returned Ok(Async::Ready(())). Read more

[src]

Flush any remaining output from this sink. Read more

[src]

This only delegates to the poll_close method of the inner sink if all other active handles have already called close. Else, it simply flushes the underlying sink, but does not close it.

Calling clone after calling close leads to ambiguity whether the inner sink has actually closed yet. It's still safe, but not advisable.

impl<S: Sink> MPS<S> for SyncMPS<S>
[src]

A future that signals when the wrapped sink is done. Read more

[src]

Create a new MPS from a sink and a Done to notify when it is done.

Auto Trait Implementations

impl<S> Send for SyncMPS<S> where
    S: Send + Sync,
    <S as Sink>::SinkError: Send

impl<S> Sync for SyncMPS<S> where
    S: Send + Sync,
    <S as Sink>::SinkError: Send