pub struct HyperStack { /* private fields */ }Implementations§
Source§impl HyperStack
impl HyperStack
pub fn builder() -> HyperStackBuilder
pub async fn connect(url: &str) -> Result<Self, HyperStackError>
pub async fn get<E: Entity>(&self, key: &str) -> Option<E::Data>
pub async fn list<E: Entity>(&self) -> Vec<E::Data>
pub fn watch<E: Entity>(&self) -> EntityStream<E::Data>
pub fn watch_key<E: Entity>(&self, key: &str) -> EntityStream<E::Data>
pub fn watch_keys<E: Entity>(&self, keys: &[&str]) -> EntityStream<E::Data>
pub fn watch_rich<E: Entity>(&self) -> RichEntityStream<E::Data>
pub fn watch_key_rich<E: Entity>(&self, key: &str) -> RichEntityStream<E::Data>
pub async fn get_data<D: EntityData>(&self, key: &str) -> Option<D>
pub async fn list_data<D: EntityData>(&self) -> Vec<D>
pub fn watch_data<D: EntityData>(&self) -> EntityStream<D>
pub fn watch_key_data<D: EntityData>(&self, key: &str) -> EntityStream<D>
pub async fn connection_state(&self) -> ConnectionState
pub async fn disconnect(&self)
pub fn store(&self) -> &SharedStore
Sourcepub fn view_builder(&self) -> ViewBuilder
pub fn view_builder(&self) -> ViewBuilder
Create a view builder for constructing typed view accessors.
This is used by generated code to create view accessor structs.
Sourcepub fn views<V: Views>(&self) -> V
pub fn views<V: Views>(&self) -> V
Get a views accessor for the specified entity type.
This provides a fluent API for accessing all views (state, list, derived) for an entity.
§Example
ⓘ
use my_stack::OreRoundViews;
let views = hs.views::<OreRoundViews>();
let latest = views.latest().get().await;
let all_rounds = views.list().get().await;Auto Trait Implementations§
impl Freeze for HyperStack
impl !RefUnwindSafe for HyperStack
impl Send for HyperStack
impl Sync for HyperStack
impl Unpin for HyperStack
impl !UnwindSafe for HyperStack
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