Expand description
View abstractions for unified access to views.
All views return collections (Vec.first() on the result
if you need a single item.
§Example
ⓘ
use hyperstack_sdk::prelude::*;
use my_stack::OreRoundViews;
let hs = HyperStack::connect("wss://example.com").await?;
// Access views through the generated views struct
let views = OreRoundViews::new(&hs);
// Get latest round - use .first() for single item
let latest = views.latest().get().await.first().cloned();
// List all rounds
let rounds = views.list().get().await;
// Get specific round by key
let round = views.state().get("round_key").await;
// Watch for updates
let mut stream = views.latest().watch();
while let Some(update) = stream.next().await {
println!("Latest round updated: {:?}", update);
}Structs§
- State
View - A state view handle that requires a key for access.
- View
Builder - Builder for creating view handles.
- View
Handle - A handle to a view that provides get/watch operations.
- Watch
Builder - Builder for configuring watch subscriptions. Implements
Streamdirectly.
Traits§
- Views
- Trait for generated view accessor structs.