Trait ValueBinding
pub trait ValueBinding<T> {
// Required method
fn pull(
&mut self,
model: &(dyn Any + 'static),
path: &(dyn Any + 'static),
) -> Pulled<T>;
// Provided methods
fn publish(&mut self, _value: &T) { ... }
fn publish_by(&mut self, _value: &T, _equal: fn(&T, &T) -> bool) { ... }
fn document_key(&self) -> Option<&str> { ... }
}Expand description
A read source and optional process-local storage for a control’s value.
Required Methods§
Provided Methods§
fn publish(&mut self, _value: &T)
fn publish(&mut self, _value: &T)
Publish a value the app set programmatically, with no model at hand. Bindings into a shared model ignore it: the app edits the model and the next pull presents the result.
fn publish_by(&mut self, _value: &T, _equal: fn(&T, &T) -> bool)
fn publish_by(&mut self, _value: &T, _equal: fn(&T, &T) -> bool)
Self::publish when equal says the value differs from the one
the binding holds: a colour published from a picker’s own floats is
the one it was given.
fn document_key(&self) -> Option<&str>
fn document_key(&self) -> Option<&str>
The document key this binding reads, reported to the action directory as the control’s collaborative binding.