pub struct StreamEvents {
    pub read_wake: Option<Waker>,
    pub write_wake: Option<Waker>,
}
Expand description

Events that are triggered through a state-update on a Stream. E.g. retrieving new data can unblock readers, which is signalled via this Event.

Fields

read_wake: Option<Waker>

A task that is waiting on the reading half of the Stream that might have been woken up due to an action.

write_wake: Option<Waker>

A task that is waiting on the writing half of the Stream that might have been woken up due to an action.

Implementations

Creates a new StreamEvents instance with no pending events

Returns the amount of Waker instances that are stored in the event

Stores a Waker which was waiting on the reading half of the Stream to get ready. The Waker will get woken up by the consumer of StreamEvents.

Stores a Waker which was waiting on the writing half of the Stream to get ready. The Waker will get woken up by the consumer of StreamEvents.

Wakes all Waker instances that have been stored via add_waker. Waking the Wakers will remove them from the StreamEventss struct.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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.