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: 'static + Sized,
F: 'static + Fn(Self::Data) -> U,
{ ... }
fn filter<F>(self, filter_function: F) -> FilterModel<Self, F>
where
Self: 'static + Sized,
F: 'static + Fn(&Self::Data) -> bool,
{ ... }
fn sort(self) -> SortModel<Self, AscendingSortHelper>
where
Self: 'static + Sized,
Self::Data: Ord,
{ ... }
fn sort_by<F>(self, sort_function: F) -> SortModel<Self, F>
where
Self: 'static + Sized,
F: 'static + FnMut(&Self::Data, &Self::Data) -> Ordering,
{ ... }
}
Expand description
Extension trait with extra methods implemented on types that implement Model
Provided Methods§
fn row_data_tracked(&self, row: usize) -> Option<Self::Data>
fn row_data_tracked(&self, row: usize) -> Option<Self::Data>
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.
fn map<F, U>(self, map_function: F) -> MapModel<Self, F>where
Self: 'static + Sized,
F: 'static + Fn(Self::Data) -> U,
fn map<F, U>(self, map_function: F) -> MapModel<Self, F>where
Self: 'static + Sized,
F: 'static + Fn(Self::Data) -> U,
Returns a new Model where all elements are mapped by the function map_function
.
This is a shortcut for MapModel::new()
.
fn filter<F>(self, filter_function: F) -> FilterModel<Self, F>where
Self: 'static + Sized,
F: 'static + Fn(&Self::Data) -> bool,
fn filter<F>(self, filter_function: F) -> FilterModel<Self, F>where
Self: 'static + Sized,
F: 'static + Fn(&Self::Data) -> bool,
Returns a new Model where the elements are filtered by the function filter_function
.
This is a shortcut for FilterModel::new()
.