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
Required methods
fn get_cloned(&self) -> Self::Item
fn get_cloned(&self) -> Self::Item
Get data (clone)
fn update(&self, value: Self::Item) -> Option<UpdateHandle>
fn update(&self, value: Self::Item) -> Option<UpdateHandle>
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
.