pub struct ItemsView<'a>(/* private fields */);Expand description
The items carried by a change notification of an untyped items list: a cheap, copyable view that produces an item only when asked for it.
See the module documentation (“Change notifications”).
Implementations§
Source§impl<'a> ItemsView<'a>
impl<'a> ItemsView<'a>
Sourcepub const fn from_slice(items: &'a [Option<BoxedValue>]) -> Self
pub const fn from_slice(items: &'a [Option<BoxedValue>]) -> Self
A view of existing untyped items.
Sourcepub fn window(list: &'a dyn IItemsList, start: usize, count: usize) -> Self
pub fn window(list: &'a dyn IItemsList, start: usize, count: usize) -> Self
A view of count items of list starting at start. Nothing is
read from the list until an item is asked for.
Sourcepub fn of_source(source: &'a ItemsSource) -> Self
pub fn of_source(source: &'a ItemsSource) -> Self
A view of all the items of source. Only the count is read.
Sourcepub fn of_source_range(
source: &'a ItemsSource,
start: usize,
count: usize,
) -> Self
pub fn of_source_range( source: &'a ItemsSource, start: usize, count: usize, ) -> Self
A view of count items of source starting at start.
Sourcepub fn from_typed<T: PropertyValue>(items: &'a TypedItems<'a, T>) -> Self
pub fn from_typed<T: PropertyValue>(items: &'a TypedItems<'a, T>) -> Self
A view of typed items, each boxed when it is read.
Sourcepub fn get(&self, index: usize) -> Option<BoxedValue>
pub fn get(&self, index: usize) -> Option<BoxedValue>
The item at index. Panics if out of range.
Sourcepub fn iter(&self) -> ItemsViewIter<'a> ⓘ
pub fn iter(&self) -> ItemsViewIter<'a> ⓘ
The items, each read when the iterator reaches it.
Sourcepub fn to_vec(&self) -> Vec<Option<BoxedValue>>
pub fn to_vec(&self) -> Vec<Option<BoxedValue>>
A copy of the items. Reads every item.
Trait Implementations§
impl<'a> Copy for ItemsView<'a>
Source§impl<'a> From<&'a ItemsSource> for ItemsView<'a>
impl<'a> From<&'a ItemsSource> for ItemsView<'a>
Source§fn from(source: &'a ItemsSource) -> Self
fn from(source: &'a ItemsSource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a [Option<Rc<dyn AnyValue>>]> for ItemsView<'a>
impl<'a> From<&'a [Option<Rc<dyn AnyValue>>]> for ItemsView<'a>
Source§fn from(items: &'a [Option<BoxedValue>]) -> Self
fn from(items: &'a [Option<BoxedValue>]) -> Self
Converts to this type from the input type.
Source§impl<'a> IntoIterator for ItemsView<'a>
impl<'a> IntoIterator for ItemsView<'a>
Source§impl<'a> IntoIterator for &ItemsView<'a>
impl<'a> IntoIterator for &ItemsView<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ItemsView<'a>
impl<'a> !Send for ItemsView<'a>
impl<'a> !Sync for ItemsView<'a>
impl<'a> !UnwindSafe for ItemsView<'a>
impl<'a> Freeze for ItemsView<'a>
impl<'a> Unpin for ItemsView<'a>
impl<'a> UnsafeUnpin for ItemsView<'a>
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more