logo
pub struct Subscription<Hasher, Event, Output> { /* private fields */ }
Expand description

A request to listen to external events.

Besides performing async actions on demand with Command, most applications also need to listen to external events passively.

A Subscription is normally provided to some runtime, like a Command, and it will generate events as long as the user keeps requesting it.

For instance, you can use a Subscription to listen to a WebSocket connection, keyboard presses, mouse events, time ticks, etc.

This type is normally aliased by runtimes with a specific Event and/or Hasher.

Implementations

Returns an empty Subscription that will not produce any output.

Creates a Subscription from a Recipe describing it.

Batches all the provided subscriptions and returns the resulting Subscription.

Returns the different recipes of the Subscription.

Adds a value to the Subscription context.

The value will be part of the identity of a Subscription.

Transforms the Subscription output with the given function.

Trait Implementations

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.