cushy::reactive::value

Trait Switchable

Source
pub trait Switchable<T>: IntoDynamic<T> + Sized {
    // Provided methods
    fn switcher<F>(self, map: F) -> Switcher
       where F: FnMut(&T, &Dynamic<T>) -> WidgetInstance + Send + 'static,
             T: Send + 'static { ... }
    fn switch_between<Collection>(self, map: Collection) -> Switcher
       where Collection: GetWidget<T> + Send + 'static,
             T: Send + 'static { ... }
}
Expand description

A type that can be the source of a Switcher widget.

Provided Methods§

Source

fn switcher<F>(self, map: F) -> Switcher
where F: FnMut(&T, &Dynamic<T>) -> WidgetInstance + Send + 'static, T: Send + 'static,

Returns a new Switcher whose contents is the result of invoking map each time self is updated.

Source

fn switch_between<Collection>(self, map: Collection) -> Switcher
where Collection: GetWidget<T> + Send + 'static, T: Send + 'static,

Returns a new Switcher whose contents switches between the values contained in map using the value in self as the key.

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.

Implementors§

Source§

impl<T, W> Switchable<T> for W
where W: IntoDynamic<T>,