Trait cushy::value::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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