pub struct ViewHandle<T> { /* private fields */ }Expand description
A handle to a view that provides get/watch operations.
All views return collections (Vec.first() on the result
if you need a single item from views with a take limit.
Implementations§
Source§impl<T> ViewHandle<T>
impl<T> ViewHandle<T>
Sourcepub async fn get(&self) -> Vec<T>
pub async fn get(&self) -> Vec<T>
Get all items from this view.
For views with a take limit defined in the stack, this returns
up to that many items. Use .first() on the result if you need
a single item.
Sourcepub fn get_sync(&self) -> Vec<T>
pub fn get_sync(&self) -> Vec<T>
Synchronously get all items from cached data.
Returns cached data immediately without waiting for subscription. Returns empty vector if data not yet loaded or lock unavailable.
Sourcepub fn listen(&self) -> UseBuilder<T>where
T: Unpin,
pub fn listen(&self) -> UseBuilder<T>where
T: Unpin,
Stream merged entities directly (simplest API - filters out deletes).
Emits T after each change. Patches are merged to give full entity state.
Deletes are filtered out. Use .watch() if you need delete notifications.
Sourcepub fn watch(&self) -> WatchBuilder<T>where
T: Unpin,
pub fn watch(&self) -> WatchBuilder<T>where
T: Unpin,
Watch for updates to this view. Chain .take(n) to limit results.
Sourcepub fn watch_rich(&self) -> RichWatchBuilder<T>where
T: Unpin,
pub fn watch_rich(&self) -> RichWatchBuilder<T>where
T: Unpin,
Watch for updates with before/after diffs.
Sourcepub fn watch_keys(&self, keys: &[&str]) -> WatchBuilder<T>where
T: Unpin,
pub fn watch_keys(&self, keys: &[&str]) -> WatchBuilder<T>where
T: Unpin,
Watch for updates filtered to specific keys.