pub struct HyperStack { /* private fields */ }Implementations§
Source§impl HyperStack
impl HyperStack
pub fn builder() -> HyperStackBuilder
pub async fn connect(url: &str) -> Result<HyperStack, HyperStackError>
pub async fn get<E>(&self, key: &str) -> Option<<E as Entity>::Data>where
E: Entity,
pub async fn list<E>(&self) -> Vec<<E as Entity>::Data>where
E: Entity,
pub fn watch<E>(&self) -> EntityStream<<E as Entity>::Data>where
E: Entity,
pub fn watch_key<E>(&self, key: &str) -> EntityStream<<E as Entity>::Data>where
E: Entity,
pub fn watch_keys<E>(&self, keys: &[&str]) -> EntityStream<<E as Entity>::Data>where
E: Entity,
pub fn watch_rich<E>(&self) -> RichEntityStream<<E as Entity>::Data>where
E: Entity,
pub fn watch_key_rich<E>(
&self,
key: &str,
) -> RichEntityStream<<E as Entity>::Data>where
E: Entity,
pub async fn get_data<D>(&self, key: &str) -> Option<D>where
D: EntityData,
pub async fn list_data<D>(&self) -> Vec<D>where
D: EntityData,
pub fn watch_data<D>(&self) -> EntityStream<D>where
D: EntityData,
pub fn watch_key_data<D>(&self, key: &str) -> EntityStream<D>where
D: EntityData,
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>(&self) -> Vwhere
V: Views,
pub fn views<V>(&self) -> Vwhere
V: Views,
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