Trait kas::updatable::SingleData[][src]

pub trait SingleData: Debug {
    type Item: Clone;
    fn get_cloned(&self) -> Self::Item;
fn update(&self, value: Self::Item) -> Option<UpdateHandle>; }
Expand description

Trait for viewable single data items

Associated Types

Output type

Required methods

Get data (clone)

Update data, if supported

This is optional and required only to support data updates through view widgets. If implemented, then Updatable::update_handle should return a copy of the same update handle.

Returns an UpdateHandle if an update occurred. Returns None if updates are unsupported.

This method takes only &self, thus some mechanism such as RefCell is required to obtain &mut and lower to SingleDataMut::set. The provider of this lowering should also provide an UpdateHandle.

Implementations on Foreign Types

Implementors