pub struct FerroListExtensions;Expand description
Defines extension methods for working with FerroLists.
Implementations§
Source§impl FerroListExtensions
impl FerroListExtensions
Sourcepub fn for_each_item<T, L>(
collection: &L,
added: impl Fn(&T) + 'static,
removed: impl Fn(&T) + 'static,
reset: impl Fn() + 'static,
weak_subscription: bool,
) -> Rc<dyn IDisposable>
pub fn for_each_item<T, L>( collection: &L, added: impl Fn(&T) + 'static, removed: impl Fn(&T) + 'static, reset: impl Fn() + 'static, weak_subscription: bool, ) -> Rc<dyn IDisposable>
Invokes an action for each item in a collection and subsequently each item added or removed from the collection.
added is called initially for each item in the collection and
subsequently for each item added to the collection; removed for
each item removed from the collection; reset when the collection is
reset. weak_subscription indicates if a weak subscription should be
used to track changes to the collection. Returns a disposable used to
terminate the subscription.
Sourcepub fn for_each_item_indexed<T, L>(
collection: &L,
added: impl Fn(usize, &T) + 'static,
removed: impl Fn(usize, &T) + 'static,
reset: impl Fn() + 'static,
weak_subscription: bool,
) -> Rc<dyn IDisposable>
pub fn for_each_item_indexed<T, L>( collection: &L, added: impl Fn(usize, &T) + 'static, removed: impl Fn(usize, &T) + 'static, reset: impl Fn() + 'static, weak_subscription: bool, ) -> Rc<dyn IDisposable>
Invokes an action for each item in a collection and subsequently each item added or removed from the collection.
added is called initially for each item in the collection and
subsequently for each item added to the collection, with the index in
the collection and the item; removed for each item removed from the
collection, with the index in the collection and the item; reset
when the collection is reset, which is followed by calls to added
for each item present in the collection after the reset.
weak_subscription indicates if a weak subscription should be used to
track changes to the collection. Returns a disposable used to
terminate the subscription.
A weak subscription is held by the returned disposable: the collection holds the handler weakly, as the weak collection changed subscription of the original does, and the handler goes when the disposable is disposed or dropped.
Sourcepub fn track_item_property_changed<T, L>(
collection: &L,
callback: impl Fn((Option<BoxedValue>, &str)) + 'static,
) -> Rc<dyn IDisposable>
pub fn track_item_property_changed<T, L>( collection: &L, callback: impl Fn((Option<BoxedValue>, &str)) + 'static, ) -> Rc<dyn IDisposable>
Listens for property changed events from all items in a collection.
callback is called for each property changed event with the item
that raised it and the name of the property. An item raises property
changed events if its model type declares them
(ModelTypes); an item that is a shared model object (Rc<M> of a
registered model type M, or a boxed value) is the object itself.
Returns a disposable used to terminate the subscription.
§Panics
The subscription panics when the collection is reset, as the original throws.
Auto Trait Implementations§
impl Freeze for FerroListExtensions
impl RefUnwindSafe for FerroListExtensions
impl Send for FerroListExtensions
impl Sync for FerroListExtensions
impl Unpin for FerroListExtensions
impl UnsafeUnpin for FerroListExtensions
impl UnwindSafe for FerroListExtensions
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more