Trait IDataSource

pub trait IDataSource: AsAny {
    // Provided methods
    fn on_loaded(&self) -> Result<(), Error> { ... }
    fn get_data(&self) -> Result<Option<Weak<DataObject<()>>>, Error> { ... }
    fn lookup_data_context(
        &self,
        relative_path: &KanziStr,
    ) -> Result<Option<Weak<DataContext>>, Error> { ... }
}

Provided Methods§

fn on_loaded(&self) -> Result<(), Error>

Override function called after loadFromKZB. The Kanzi Studio Preview can call the on_loaded function multiple times whenever the user edits properties of the data source or refreshes the data source. Note that calling notify_modified will not trigger this callback.

fn get_data(&self) -> Result<Option<Weak<DataObject<()>>>, Error>

Retrieves the root object of the underlying data tree.

fn lookup_data_context( &self, relative_path: &KanziStr, ) -> Result<Option<Weak<DataContext>>, Error>

Performs object look-up by path.

  • relative_path - Path of the object where to look at, separated by ‘.’.
§Returns

Data object that was found, or None if there was no such object.

Implementors§