Trait hooks::HookValue

source ·
pub trait HookValue<'hook, ImplicitBounds = &'hook Self>where
    ImplicitBounds: HookValueBounds<'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.

Implementations on Foreign Types§

source§

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

§

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

source§

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

§

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

source§

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

§

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

Implementors§

source§

impl<'hook, 'a, T: PollNextUpdateFromStateUpdater<EQ>, const N: usize, const EQ: bool> HookValue<'hook, &'hook State<'a, T, N, EQ>> for State<'a, T, N, EQ>

§

type Value = (&'hook mut T, &'hook StateUpdater<'a, T, N>)

source§

impl<'hook, Data, Dep> HookValue<'hook, &'hook Memo<Data, Dep>> for Memo<Data, Dep>

source§

impl<'hook, Dep, E: EffectFor<Dep>> HookValue<'hook, &'hook Effect<Dep, E>> for Effect<Dep, E>

§

type Value = ()

source§

impl<'hook, E: EffectForNoneDependency> HookValue<'hook, &'hook EffectOnNextPoll<E>> for EffectOnNextPoll<E>

§

type Value = ()

source§

impl<'hook, E: EffectForNoneDependency> HookValue<'hook, &'hook EffectOnce<E>> for EffectOnce<E>

§

type Value = ()

source§

impl<'hook, H: HookPollNextUpdate + HookUnmount + Default> HookValue<'hook, &'hook UninitializedHook<H>> for UninitializedHook<H>

§

type Value = Pin<&'hook mut UninitializedHook<H>>

source§

impl<'hook, H: HookPollNextUpdate + HookUnmount> HookValue<'hook, &'hook LazyPinnedHook<H>> for LazyPinnedHook<H>

§

type Value = Pin<&'hook mut LazyPinnedHook<H>>

source§

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

source§

impl<'hook, P: FnMut(&mut Context<'_>) -> Poll<bool>> HookValue<'hook, &'hook PollNextUpdate<P>> for PollNextUpdate<P>

§

type Value = ()

source§

impl<'hook, T> HookValue<'hook, &'hook Mut<T>> for Mut<T>

source§

impl<'hook, T> HookValue<'hook, &'hook Pinned<T>> for Pinned<T>

source§

impl<'hook, T> HookValue<'hook, &'hook SharedRef<T>> for SharedRef<T>

§

type Value = &'hook SharedRef<T>

source§

impl<'hook, T> HookValue<'hook, &'hook SharedState<T>> for SharedState<T>

§

type Value = &'hook SharedState<T>

source§

impl<'hook, T: PartialEq> HookValue<'hook, &'hook SharedStateEq<T>> for SharedStateEq<T>

§

type Value = &'hook SharedStateEq<T>