pub trait IntoAsyncHook<K: HookEvent>:
for<'a, 'b> Fn(&'b mut K::Event<'a>) -> BoxFuture<'b, Self::Output>
+ Send
+ Sync
+ 'static {
type Output: HookOutput;
}Expand description
An async closure usable as a hook for the event K: it returns Box::pin(async move { .. })
whose output is a HookOutput.
Implemented for every such closure; name the event with
add_async_hook::<E>.
Required Associated Types§
Sourcetype Output: HookOutput
type Output: HookOutput
What the closure’s future returns.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".