dioxus_hooks

Trait Dependency

Source
pub trait Dependency: Sized + Clone {
    type Out: Clone + PartialEq + 'static;

    // Required method
    fn out(&self) -> Self::Out;

    // Provided method
    fn changed(&self, other: &Self::Out) -> bool { ... }
}
Expand description

A dependency is a trait that can be used to determine if a effect or selector should be re-run.

Required Associated Types§

Source

type Out: Clone + PartialEq + 'static

The output of the dependency

Required Methods§

Source

fn out(&self) -> Self::Out

Returns the output of the dependency.

Provided Methods§

Source

fn changed(&self, other: &Self::Out) -> bool

Returns true if the dependency has changed.

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.

Implementations on Foreign Types§

Source§

impl Dependency for ()

Source§

type Out = ()

Source§

fn out(&self) -> Self::Out

Source§

impl<A> Dependency for (&A,)

Source§

type Out = (A,)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A, B> Dependency for (&A, &B)

Source§

type Out = (A, B)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A, B, C> Dependency for (&A, &B, &C)

Source§

type Out = (A, B, C)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A, B, C, D> Dependency for (&A, &B, &C, &D)

Source§

type Out = (A, B, C, D)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A, B, C, D, E> Dependency for (&A, &B, &C, &D, &E)

Source§

type Out = (A, B, C, D, E)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A, B, C, D, E, F> Dependency for (&A, &B, &C, &D, &E, &F)

Source§

type Out = (A, B, C, D, E, F)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A, B, C, D, E, F, G> Dependency for (&A, &B, &C, &D, &E, &F, &G)

Source§

type Out = (A, B, C, D, E, F, G)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A, B, C, D, E, F, G, H> Dependency for (&A, &B, &C, &D, &E, &F, &G, &H)

Source§

type Out = (A, B, C, D, E, F, G, H)

Source§

fn out(&self) -> Self::Out

Source§

fn changed(&self, other: &Self::Out) -> bool

Source§

impl<A: DependencyElement> Dependency for &A

Source§

type Out = A

Source§

fn out(&self) -> Self::Out

Implementors§