pub struct Repeater<C: RepeatedItemTree>(/* private fields */);
Implementations§
Source§impl<C: RepeatedItemTree + 'static> Repeater<C>
impl<C: RepeatedItemTree + 'static> Repeater<C>
Sourcepub fn ensure_updated(
self: Pin<&Self>,
init: impl Fn() -> VRc<ItemTreeVTable, C>,
)
pub fn ensure_updated( self: Pin<&Self>, init: impl Fn() -> VRc<ItemTreeVTable, C>, )
Call this function to make sure that the model is updated. The init function is the function to create a ItemTree
Sourcepub fn ensure_updated_listview(
self: Pin<&Self>,
init: impl Fn() -> VRc<ItemTreeVTable, C>,
viewport_width: Pin<&Property<LogicalLength>>,
viewport_height: Pin<&Property<LogicalLength>>,
viewport_y: Pin<&Property<LogicalLength>>,
listview_width: LogicalLength,
listview_height: Pin<&Property<LogicalLength>>,
)
pub fn ensure_updated_listview( self: Pin<&Self>, init: impl Fn() -> VRc<ItemTreeVTable, C>, viewport_width: Pin<&Property<LogicalLength>>, viewport_height: Pin<&Property<LogicalLength>>, viewport_y: Pin<&Property<LogicalLength>>, listview_width: LogicalLength, listview_height: Pin<&Property<LogicalLength>>, )
Same as Self::ensure_updated
but for a ListView
Sourcepub fn model_set_row_data(self: Pin<&Self>, row: usize, data: C::Data)
pub fn model_set_row_data(self: Pin<&Self>, row: usize, data: C::Data)
Sets the data directly in the model
Sourcepub fn set_model_binding(
&self,
binding: impl Fn() -> ModelRc<C::Data> + 'static,
)
pub fn set_model_binding( &self, binding: impl Fn() -> ModelRc<C::Data> + 'static, )
Set the model binding
Sourcepub fn visit(
&self,
order: TraversalOrder,
visitor: ItemVisitorRefMut<'_>,
) -> VisitChildrenResult
pub fn visit( &self, order: TraversalOrder, visitor: ItemVisitorRefMut<'_>, ) -> VisitChildrenResult
Call the visitor for the root of each instance
Sourcepub fn range(&self) -> Range<usize>
pub fn range(&self) -> Range<usize>
Return the range of indices used by this Repeater.
Two values are necessary here since the Repeater can start to insert the data from its model at an offset.
Sourcepub fn instance_at(&self, index: usize) -> Option<VRc<ItemTreeVTable, C>>
pub fn instance_at(&self, index: usize) -> Option<VRc<ItemTreeVTable, C>>
Return the instance for the given model index.
The index should be within Self::range()
Sourcepub fn instances_vec(&self) -> Vec<VRc<ItemTreeVTable, C>>
pub fn instances_vec(&self) -> Vec<VRc<ItemTreeVTable, C>>
Returns a vector containing all instances
Trait Implementations§
Source§impl<C: RepeatedItemTree> Default for Repeater<C>
impl<C: RepeatedItemTree> Default for Repeater<C>
impl<'pin, C: RepeatedItemTree> Unpin for Repeater<C>where
PinnedFieldsOf<__Repeater<'pin, C>>: Unpin,
Auto Trait Implementations§
impl<C> !Freeze for Repeater<C>
impl<C> !RefUnwindSafe for Repeater<C>
impl<C> !Send for Repeater<C>
impl<C> !Sync for Repeater<C>
impl<C> !UnwindSafe for Repeater<C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more