Struct flo_stream::WeakPublisher[][src]

pub struct WeakPublisher<Message> { /* fields omitted */ }
Expand description

A weak publisher republishes a Publisher only so long as that Publisher exists.

This type of publisher can be created by calling republish_weak() on a Publisher. The subscribers will close if the Publisher is released even if the WeakPublisher still exists.

This is useful as a way to send messages to a stream without ‘owning’ it, where it’s acceptable for the messages to be dropped once the target has gone away (eg: messages to a window in a user interface might not longer be relevant once the window has closed)

Implementations

Counts the number of subscribers in this publisher

Creates a duplicate publisher that can be used to publish to the same streams as this object

Trait Implementations

Subscribes to this publisher

Subscribers only receive messages sent to the publisher after they are created.

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

Waits until all subscribers have consumed all pending messages

Returns true if this publisher is closed (will not publish any further messages to its subscribers)

Future that returns when this publisher is closed

Publishes a message to the subscribers of this object Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.