Skip to main content

GroupTokenExt

Trait GroupTokenExt 

Source
pub trait GroupTokenExt<T>: Sized {
    // Provided methods
    fn release_on_ready(self, token: T) -> GroupTokenReleaseOnReady<Self, T>  { ... }
    fn release_on_drop(self, token: T) -> GroupTokenReleaseOnDrop<Self, T>  { ... }
}
Expand description

Extension trait for futures to automatically release group tokens.

Provided Methods§

Source

fn release_on_ready(self, token: T) -> GroupTokenReleaseOnReady<Self, T>

Releases the group token when the future is ready or dropped.

Source

fn release_on_drop(self, token: T) -> GroupTokenReleaseOnDrop<Self, T>

Releases the group token when the future is dropped.

The token is held for the entire lifetime of the future, even if the future is ready.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: GroupTokenType, F: Future> GroupTokenExt<T> for F