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 { ... }
}
Available on crate feature hooks only.
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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Dependency for ()

§

type Out = ()

source§

fn out(&self) -> <() as Dependency>::Out

source§

impl<A> Dependency for (&A,)

§

type Out = (A,)

source§

fn out(&self) -> <(&A,) as Dependency>::Out

source§

fn changed(&self, other: &<(&A,) as Dependency>::Out) -> bool

source§

impl<A> Dependency for &A

§

type Out = A

source§

fn out(&self) -> <&A as Dependency>::Out

source§

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

§

type Out = (A, B)

source§

fn out(&self) -> <(&A, &B) as Dependency>::Out

source§

fn changed(&self, other: &<(&A, &B) as Dependency>::Out) -> bool

source§

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

§

type Out = (A, B, C)

source§

fn out(&self) -> <(&A, &B, &C) as Dependency>::Out

source§

fn changed(&self, other: &<(&A, &B, &C) as Dependency>::Out) -> bool

source§

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

§

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

source§

fn out(&self) -> <(&A, &B, &C, &D) as Dependency>::Out

source§

fn changed(&self, other: &<(&A, &B, &C, &D) as Dependency>::Out) -> bool

source§

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

§

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

source§

fn out(&self) -> <(&A, &B, &C, &D, &E) as Dependency>::Out

source§

fn changed(&self, other: &<(&A, &B, &C, &D, &E) as Dependency>::Out) -> bool

source§

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

§

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

source§

fn out(&self) -> <(&A, &B, &C, &D, &E, &F) as Dependency>::Out

source§

fn changed(&self, other: &<(&A, &B, &C, &D, &E, &F) as Dependency>::Out) -> bool

source§

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

§

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

source§

fn out(&self) -> <(&A, &B, &C, &D, &E, &F, &G) as Dependency>::Out

source§

fn changed( &self, other: &<(&A, &B, &C, &D, &E, &F, &G) as Dependency>::Out ) -> bool

source§

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

§

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

source§

fn out(&self) -> <(&A, &B, &C, &D, &E, &F, &G, &H) as Dependency>::Out

source§

fn changed( &self, other: &<(&A, &B, &C, &D, &E, &F, &G, &H) as Dependency>::Out ) -> bool

Implementors§