pub struct VirtualSource { /* private fields */ }Expand description
A lazily materialized, keyed source for a virtualizing control.
Item functions are called only for indices that the control needs to realize.
Implementations§
Source§impl VirtualSource
impl VirtualSource
Sourcepub fn new<K, V, KI, VI>(key_revision: u64, len: usize, key: K, view: V) -> Self
pub fn new<K, V, KI, VI>(key_revision: u64, len: usize, key: K, view: V) -> Self
Creates an indexed source whose item views are built only when needed.
key_revision must change whenever the length, order, or value of any key changes. It may
remain unchanged when only item view data changes. The key and view functions are called
only with indices less than len.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn key_revision(&self) -> u64
Trait Implementations§
Source§impl Clone for VirtualSource
impl Clone for VirtualSource
Source§fn clone(&self) -> VirtualSource
fn clone(&self) -> VirtualSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VirtualSource
impl Debug for VirtualSource
Auto Trait Implementations§
impl !RefUnwindSafe for VirtualSource
impl !Send for VirtualSource
impl !Sync for VirtualSource
impl !UnwindSafe for VirtualSource
impl Freeze for VirtualSource
impl Unpin for VirtualSource
impl UnsafeUnpin for VirtualSource
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