pub struct StateCell<T> { /* private fields */ }
Expand description

Track change of value and notify the Executor. This struct has no method and implements Deref, DerefMut. When inner value is mutable dereferenced, it changes status and wake pending task. This will also wake pending task when the cell is dropped.

Implementations§

Create new StateCell

Invalidate this StateCell. It wakes task if there is any waker pending.

Check if there are any changes or saves waker to wake task to notify when the value is changed.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Executes the destructor for this type. Read more
Converts to this type from the input type.

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
Converts to this type from the input type.

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.