Struct mimicry::AnswersGuard

source ·
pub struct AnswersGuard<'a, V> { /* private fields */ }
Expand description

Guard ensuring that answers sent from an AnswersSender are timely consumed.

The consumption check is performed on guard drop: either implicit, or explicit via Self::scope().

Implementations

Executes the provided closure and checks that all the answers were consumed by it.

Executes the provided future and checks that all the answers were consumed by it.

While Self::scope().await with a closure that returns a future technically works, it will probably result in a failed consumption check. Indeed, the scope will be exited and the guard dropped before the future is polled.

Drops this guard discarding any remaining answers, so that the guard does not panic.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this 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.