[][src]Struct flo_stream::PublisherSink

pub struct PublisherSink<Publisher> where
    Publisher: MessagePublisher
{ /* fields omitted */ }

An implementation of the Sink trait that can be applied to publishers

Methods

impl<Publisher> PublisherSink<Publisher> where
    Publisher: MessagePublisher
[src]

pub fn as_publisher<'a>(&'a mut self) -> Option<&'a mut Publisher>[src]

Provides access to the underlying MessagePublisher for this sink

pub fn subscribe(&mut self) -> Option<Subscriber<Publisher::Message>>[src]

Creates a subscription to this publisher

Any future messages sent here will also be sent to this subscriber. Returns None if the sink has been closed

pub fn when_ready(
    &mut self
) -> Option<BoxFuture<'static, MessageSender<Publisher::Message>>>
[src]

Reserves a space for a message with the subscribers, returning when it's ready

pub fn when_empty(&mut self) -> Option<BoxFuture<'static, ()>>[src]

Waits until all subscribers have consumed all pending messages

Returns None if the sink has been closed.

pub fn publish(
    &mut self,
    message: Publisher::Message
) -> Option<BoxFuture<'static, ()>>
[src]

Publishes a message to the subscribers of this object

Returns None if the sink has been closed

Trait Implementations

impl<Publisher> Sink<<Publisher as MessagePublisher>::Message> for PublisherSink<Publisher> where
    Publisher: MessagePublisher,
    Self: Unpin
[src]

type Error = ()

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

Auto Trait Implementations

impl<Publisher> !RefUnwindSafe for PublisherSink<Publisher>

impl<Publisher> Send for PublisherSink<Publisher>

impl<Publisher> !Sync for PublisherSink<Publisher>

impl<Publisher> Unpin for PublisherSink<Publisher> where
    Publisher: Unpin

impl<Publisher> !UnwindSafe for PublisherSink<Publisher>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.