Trait hooks_core::HookValue

source ·
pub trait HookValue<'hook, ImplicitBounds: HookValueBounds<'hook, Self> = &'hook Self> {
    type Value;
}
Expand description

A helper trait to define lifetime generic associated types (lifetime-GAT) for Hook.

This trait follows the better GAT pattern. better GAT is a pattern which implements lifetime-GAT without real GAT, and it also solves some problems relating to for<'hook> HookValue<Value<'hook> = ...> that real GAT currently doesn’t solve.

Please don’t impl this trait manually because in the future this will be changed to GAT. Instead, use impl_hook![...];.

Required Associated Types§

source

type Value

The output type of Hook::use_hook.

Please don’t use this associated type directly. Instead, use Value![] for future compatibility.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'hook, H: Hook + Unpin + ?Sized> HookValue<'hook> for &mut H

§

type Value = <H as HookValue<'hook>>::Value

source§

impl<'hook, H: Hook + Unpin + ?Sized> HookValue<'hook> for Box<H>

§

type Value = <H as HookValue<'hook>>::Value

source§

impl<'hook, P> HookValue<'hook> for Pin<P>
where P: DerefMut, <P as Deref>::Target: Hook,

§

type Value = <<P as Deref>::Target as HookValue<'hook>>::Value

Implementors§

source§

impl<'hook, InnerHook: Default + HookPollNextUpdate + HookUnmount, U: FnMutOneArg<Pin<&'hook mut InnerHook>>, I: Initialized> HookValue<'hook> for FnHook<InnerHook, U, I>