Struct sixtyfps::VecModel [−]
pub struct VecModel<T> { /* fields omitted */ }
Expand description
A model backed by a SharedVector
Implementations
impl<T> VecModel<T> where
T: 'static,
impl<T> VecModel<T> where
T: 'static,
pub fn from_slice(slice: &[T]) -> ModelHandle<T> where
T: Clone,
pub fn from_slice(slice: &[T]) -> ModelHandle<T> where
T: Clone,
Allocate a new model from a slice
pub fn push(&self, value: T)
pub fn push(&self, value: T)
Add a row at the end of the model
Trait Implementations
type Data = T
type Data = T
The model data: A model is a set of row and each row has this data
Returns the data for a particular row. This function should be called with row < row_count()
.
pub fn set_row_data(&self, row: usize, data: <VecModel<T> as Model>::Data)
pub fn set_row_data(&self, row: usize, data: <VecModel<T> as Model>::Data)
Sets the data for a particular row. This function should be called with row < row_count()
.
If the model cannot support data changes, then it is ok to do nothing (default implementation).
If the model can update the data, it should also call row_changed on its internal ModelNotify
. Read more
pub fn attach_peer(&self, peer: ModelPeer)
pub fn attach_peer(&self, peer: ModelPeer)
Should forward to the internal ModelNotify::attach
Auto Trait Implementations
impl<T> !RefUnwindSafe for VecModel<T>
impl<T> !UnwindSafe for VecModel<T>