Skip to main content

ValueBinding

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 document_key(&self) -> Option<&str> { ... }
}
Expand description

A read source and optional process-local storage for a control’s value.

Required Methods§

fn pull( &mut self, model: &(dyn Any + 'static), path: &(dyn Any + 'static), ) -> Pulled<T>

The value to present, read in the sync pass before layout.

Provided Methods§

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 document_key(&self) -> Option<&str>

The document key this binding reads, reported to the action directory as the control’s collaborative binding.

Implementors§