pub struct Giver { /* private fields */ }
Expand description

An entity that gives a value when wanted.

Implementations

Returns a Future that fulfills when the Taker has done some action.

Poll whether the Taker has registered interest in another value.

  • If the Taker has called want(), this returns Async::Ready(()).
  • If the Taker has not called want() since last poll, this returns Async::NotReady, and parks the current task to be notified when the Taker does call want().
  • If the Taker has canceled (or dropped), this returns Closed.

After knowing that the Taker is wanting, the state can be reset by calling give.

Mark the state as idle, if the Taker currently is wanting.

Returns true if Taker was wanting, false otherwise.

Check if the Taker has called want() without parking a task.

This is safe to call outside of a futures task context, but other means of being notified is left to the user.

Check if the Taker has canceled interest without parking a task.

Converts this into a SharedGiver.

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.