Struct hooks::effect::Effect

source ·
pub struct Effect<Dep, E: EffectFor<Dep>> { /* private fields */ }

Implementations§

source§

impl<Dep, E: EffectFor<Dep>> Effect<Dep, E>

source

pub fn register_effect_if_dep_ne(self: Pin<&mut Self>, effect: E, dep: Dep)where Dep: PartialEq,

source

pub fn register_effect_if( self: Pin<&mut Self>, get_new_dep_and_effect: impl FnOnce(&mut Option<Dep>) -> Option<E> )

Trait Implementations§

source§

impl<Dep: Debug, E: EffectFor<Dep>> Debug for Effect<Dep, E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Dep, E: EffectFor<Dep>> Default for Effect<Dep, E>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<Dep, E: EffectFor<Dep>> Hook for Effect<Dep, E>

source§

fn use_hook(self: Pin<&mut Self>) -> <Self as HookValue<'_>>::Value

source§

impl<Dep, E: EffectFor<Dep>> HookPollNextUpdate for Effect<Dep, E>

source§

fn poll_next_update(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<bool>

The meaning of the return value is: Read more
source§

impl<Dep, E: EffectFor<Dep>> HookUnmount for Effect<Dep, E>

source§

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

§

type Value = ()

The output type of Hook::use_hook. Read more
source§

impl<Dep, E: EffectFor<Dep>> Unpin for Effect<Dep, E>

Auto Trait Implementations§

§

impl<Dep, E> RefUnwindSafe for Effect<Dep, E>where Dep: RefUnwindSafe, E: RefUnwindSafe, <E as EffectFor<Dep>>::Cleanup: RefUnwindSafe,

§

impl<Dep, E> Send for Effect<Dep, E>where Dep: Send, E: Send, <E as EffectFor<Dep>>::Cleanup: Send,

§

impl<Dep, E> Sync for Effect<Dep, E>where Dep: Sync, E: Sync, <E as EffectFor<Dep>>::Cleanup: Sync,

§

impl<Dep, E> UnwindSafe for Effect<Dep, E>where Dep: UnwindSafe, E: UnwindSafe, <E as EffectFor<Dep>>::Cleanup: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<H> HookExt for Hwhere H: Hook + ?Sized,

source§

fn use_hook(&mut self) -> Self::Valuewhere Self: Unpin,

A shortcut to call Hook::use_hook on Unpin hooks.
source§

fn next_value(&mut self) -> NextValue<'_, Self>where Self: Unpin,

source§

fn into_values(self) -> Values<Self>where Self: Sized,

source§

fn values(&mut self) -> Values<&mut Self>where Self: Unpin,

source§

impl<H> HookPollNextUpdateExt for Hwhere H: HookPollNextUpdate + ?Sized,

source§

fn poll_next_update(&mut self, cx: &mut Context<'_>) -> Poll<bool>where Self: Unpin,

A shortcut to call HookPollNextUpdate::poll_next_update on Unpin hooks.
source§

fn next_update(&mut self) -> NextUpdate<'_, Self>where Self: Unpin,

Get a future which polls HookPollNextUpdate::poll_next_update.
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<H> IntoHook for Hwhere H: Hook,

§

type Hook = H

source§

fn into_hook(self) -> <H as IntoHook>::Hook

source§

fn into_hook_values(self) -> Values<Self::Hook>where Self: Sized,

source§

impl<H, V> NonLendingHook for Hwhere H: for<'hook> Hook<Value = V> + for<'hook> HookValue<'hook, &'hook H>,

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.