[][src]Trait iced_futures::subscription::Recipe

pub trait Recipe<Hasher: Hasher, Event> {
    type Output;
    fn hash(&self, state: &mut Hasher);
fn stream(
        self: Box<Self>,
        input: BoxStream<Event>
    ) -> BoxStream<Self::Output>; }

The description of a Subscription.

A Recipe is the internal definition of a Subscription. It is used by runtimes to run and identify subscriptions. You can use it to create your own!

Examples

The repository has a couple of examples that use a custom Recipe:

Associated Types

type Output

The events that will be produced by a Subscription with this Recipe.

Loading content...

Required methods

fn hash(&self, state: &mut Hasher)

Hashes the Recipe.

This is used by runtimes to uniquely identify a Subscription.

fn stream(self: Box<Self>, input: BoxStream<Event>) -> BoxStream<Self::Output>

Executes the Recipe and produces the stream of events of its Subscription.

It receives some stream of generic events, which is normally defined by shells.

Loading content...

Implementors

Loading content...