Skip to main content

VirtualCollectionSource

Trait VirtualCollectionSource 

Source
pub trait VirtualCollectionSource<K, T>: Observable<u64> {
    // Required methods
    fn revision(&self) -> u64;
    fn keys(&self) -> Vec<K>;
    fn item(&self, key: &K) -> Option<T>;
    fn changes_since(&self, revision: u64) -> CollectionSync<K>;

    // Provided method
    fn window(&self) -> CollectionWindow { ... }
}
Expand description

Architecture-neutral data source consumed by VirtualList.

Sources without an incremental journal may always return CollectionSync::Reset. The default VirtualCollectionModel keeps a bounded key-only journal so normal insert, remove, move, and update operations do not require rebuilding collection metrics.

Required Methods§

Source

fn revision(&self) -> u64

Source

fn keys(&self) -> Vec<K>

Source

fn item(&self, key: &K) -> Option<T>

Source

fn changes_since(&self, revision: u64) -> CollectionSync<K>

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, T> VirtualCollectionSource<K, T> for VirtualCollectionModel<K, T>
where K: Clone + Eq + Hash + 'static, T: Clone + PartialEq + 'static,