Struct i_slint_core::model::Repeater
source · [−]pub struct Repeater<C: RepeatedComponent>(_);
Implementations
sourceimpl<C: RepeatedComponent + 'static> Repeater<C>
impl<C: RepeatedComponent + 'static> Repeater<C>
sourcepub fn ensure_updated(
self: Pin<&Self>,
init: impl Fn() -> VRc<ComponentVTable, C>
)
pub fn ensure_updated(
self: Pin<&Self>,
init: impl Fn() -> VRc<ComponentVTable, C>
)
Call this function to make sure that the model is updated. The init function is the function to create a component
sourcepub fn ensure_updated_listview(
self: Pin<&Self>,
init: impl Fn() -> VRc<ComponentVTable, C>,
viewport_width: Pin<&Property<Coord>>,
viewport_height: Pin<&Property<Coord>>,
viewport_y: Pin<&Property<Coord>>,
listview_width: Coord,
listview_height: Pin<&Property<Coord>>
)
pub fn ensure_updated_listview(
self: Pin<&Self>,
init: impl Fn() -> VRc<ComponentVTable, C>,
viewport_width: Pin<&Property<Coord>>,
viewport_height: Pin<&Property<Coord>>,
viewport_y: Pin<&Property<Coord>>,
listview_width: Coord,
listview_height: Pin<&Property<Coord>>
)
Same as Self::ensuer_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 each component
sourcepub fn range(&self) -> (usize, usize)
pub fn range(&self) -> (usize, 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.
pub fn component_at(&self, index: usize) -> Option<VRc<ComponentVTable, C>>
Trait Implementations
sourceimpl<C: RepeatedComponent> Default for Repeater<C>
impl<C: RepeatedComponent> Default for Repeater<C>
impl<'pin, C: RepeatedComponent> Unpin for Repeater<C> where
__Repeater<'pin, C>: Unpin,
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more