Skip to main content

GroupTokenFuncExt

Trait GroupTokenFuncExt 

Source
pub trait GroupTokenFuncExt<T, Output>: Sized {
    // Required method
    fn release_on_return(self, token: T) -> impl FnOnce() -> Output + Send;
}
Expand description

Extension trait for FnOnce to automatically release group tokens.

Required Methods§

Source

fn release_on_return(self, token: T) -> impl FnOnce() -> Output + Send

Releases the group token when the closure returns.

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, Output, F: Send + FnOnce() -> Output> GroupTokenFuncExt<T, Output> for F