Trait slint::ModelExt

pub trait ModelExt: Model {
    fn row_data_tracked(&self, row: usize) -> Option<Self::Data> { ... }
    fn map<F, U>(self, map_function: F) -> MapModel<Self, F>
    where
        Self: Sized + 'static,
        F: Fn(Self::Data) -> U + 'static
, { ... } fn filter<F>(self, filter_function: F) -> FilterModel<Self, F>
    where
        Self: Sized + 'static,
        F: Fn(&Self::Data) -> bool + 'static
, { ... } fn sort(self) -> SortModel<Self, AscendingSortHelper>
    where
        Self: Sized + 'static,
        Self::Data: Ord
, { ... } fn sort_by<F>(self, sort_function: F) -> SortModel<Self, F>
    where
        Self: Sized + 'static,
        F: FnMut(&Self::Data, &Self::Data) -> Ordering + 'static
, { ... } }
Expand description

Extension trait with extra methods implemented on types that implement Model

Provided Methods§

Convenience function that calls ModelTracker::track_row_data_changes before returning Model::row_data.

Calling row_data(row) does not register the row as a dependency when calling it while evaluating a property binding. This function calls track_row_data_changes(row) on the self.model_tracker() to enable tracking.

Returns a new Model where all elements are mapped by the function map_function. This is a shortcut for MapModel::new().

Returns a new Model where the elements are filtered by the function filter_function. This is a shortcut for FilterModel::new().

Returns a new Model where the elements are sorted ascending. This is a shortcut for SortModel::new_ascending().

Returns a new Model where the elements are sorted by the function sort_function. This is a shortcut for SortModel::new().

Implementors§