cushy::reactive::value

Trait ForEach

Source
pub trait ForEach<T> {
    type Ref<'a>;

    // Required methods
    fn for_each<F>(&self, for_each: F) -> CallbackHandle
       where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static;
    fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
       where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static;
}
Expand description

A type that can have a for_each operation applied to it.

Required Associated Types§

Source

type Ref<'a>

The borrowed representation of T to pass into the for_each function.

Required Methods§

Source

fn for_each<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Invokes for_each with the current contents and each time this source’s contents are updated.

Source

fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Attaches for_each to this value so that it is invoked each time the source’s contents are updated.

for_each will not be invoked with the currently stored value.

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<T0, Y0> ForEach<(T0,)> for (&Y0,)
where Y0: DynamicRead<T0> + Source<T0> + Clone + Send + 'static, T0: Send + 'static,

Source§

type Ref<'a> = (&'a T0,)

Source§

fn for_each<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

impl<T0, Y0, T1, Y1> ForEach<(T0, T1)> for (&Y0, &Y1)
where Y0: DynamicRead<T0> + Source<T0> + Clone + Send + 'static, T0: Send + 'static, Y1: DynamicRead<T1> + Source<T1> + Clone + Send + 'static, T1: Send + 'static,

Source§

type Ref<'a> = (&'a T0, &'a T1)

Source§

fn for_each<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

impl<T0, Y0, T1, Y1, T2, Y2> ForEach<(T0, T1, T2)> for (&Y0, &Y1, &Y2)
where Y0: DynamicRead<T0> + Source<T0> + Clone + Send + 'static, T0: Send + 'static, Y1: DynamicRead<T1> + Source<T1> + Clone + Send + 'static, T1: Send + 'static, Y2: DynamicRead<T2> + Source<T2> + Clone + Send + 'static, T2: Send + 'static,

Source§

type Ref<'a> = (&'a T0, &'a T1, &'a T2)

Source§

fn for_each<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

impl<T0, Y0, T1, Y1, T2, Y2, T3, Y3> ForEach<(T0, T1, T2, T3)> for (&Y0, &Y1, &Y2, &Y3)
where Y0: DynamicRead<T0> + Source<T0> + Clone + Send + 'static, T0: Send + 'static, Y1: DynamicRead<T1> + Source<T1> + Clone + Send + 'static, T1: Send + 'static, Y2: DynamicRead<T2> + Source<T2> + Clone + Send + 'static, T2: Send + 'static, Y3: DynamicRead<T3> + Source<T3> + Clone + Send + 'static, T3: Send + 'static,

Source§

type Ref<'a> = (&'a T0, &'a T1, &'a T2, &'a T3)

Source§

fn for_each<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

impl<T0, Y0, T1, Y1, T2, Y2, T3, Y3, T4, Y4> ForEach<(T0, T1, T2, T3, T4)> for (&Y0, &Y1, &Y2, &Y3, &Y4)
where Y0: DynamicRead<T0> + Source<T0> + Clone + Send + 'static, T0: Send + 'static, Y1: DynamicRead<T1> + Source<T1> + Clone + Send + 'static, T1: Send + 'static, Y2: DynamicRead<T2> + Source<T2> + Clone + Send + 'static, T2: Send + 'static, Y3: DynamicRead<T3> + Source<T3> + Clone + Send + 'static, T3: Send + 'static, Y4: DynamicRead<T4> + Source<T4> + Clone + Send + 'static, T4: Send + 'static,

Source§

type Ref<'a> = (&'a T0, &'a T1, &'a T2, &'a T3, &'a T4)

Source§

fn for_each<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

impl<T0, Y0, T1, Y1, T2, Y2, T3, Y3, T4, Y4, T5, Y5> ForEach<(T0, T1, T2, T3, T4, T5)> for (&Y0, &Y1, &Y2, &Y3, &Y4, &Y5)
where Y0: DynamicRead<T0> + Source<T0> + Clone + Send + 'static, T0: Send + 'static, Y1: DynamicRead<T1> + Source<T1> + Clone + Send + 'static, T1: Send + 'static, Y2: DynamicRead<T2> + Source<T2> + Clone + Send + 'static, T2: Send + 'static, Y3: DynamicRead<T3> + Source<T3> + Clone + Send + 'static, T3: Send + 'static, Y4: DynamicRead<T4> + Source<T4> + Clone + Send + 'static, T4: Send + 'static, Y5: DynamicRead<T5> + Source<T5> + Clone + Send + 'static, T5: Send + 'static,

Source§

type Ref<'a> = (&'a T0, &'a T1, &'a T2, &'a T3, &'a T4, &'a T5)

Source§

fn for_each<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Source§

fn for_each_subsequent<F>(&self, for_each: F) -> CallbackHandle
where F: for<'a> FnMut(Self::Ref<'a>) + Send + 'static,

Implementors§