pub struct SharedStore { /* private fields */ }Implementations§
pub fn new() -> Self
pub fn with_config(config: StoreConfig) -> Self
pub async fn apply_frame(&self, frame: Frame)
pub async fn mark_view_ready(&self, view: &str)
pub async fn wait_for_view_ready(&self, view: &str, timeout: Duration) -> bool
pub async fn get<T: DeserializeOwned>(&self, view: &str, key: &str) -> Option<T>
pub async fn list<T: DeserializeOwned>(&self, view: &str) -> Vec<T>
pub async fn all_raw(&self, view: &str) -> HashMap<String, Value>
Sourcepub fn get_sync<T: DeserializeOwned>(&self, view: &str, key: &str) -> Option<T>
pub fn get_sync<T: DeserializeOwned>(&self, view: &str, key: &str) -> Option<T>
Synchronously get a single entity by key.
Returns None if the view doesn’t exist or the key is not found.
This is a non-blocking operation using try_read().
Use this in synchronous contexts where you can’t await.
If the lock is held by another task, returns None.
Sourcepub fn list_sync<T: DeserializeOwned>(&self, view: &str) -> Vec<T>
pub fn list_sync<T: DeserializeOwned>(&self, view: &str) -> Vec<T>
Synchronously get all entities from a view.
Returns an empty vector if the view doesn’t exist.
This is a non-blocking operation using try_read().
Use this in synchronous contexts where you can’t await. If the lock is held by another task, returns an empty vector.
pub fn subscribe(&self) -> Receiver<StoreUpdate>
pub async fn apply_subscribed_frame(&self, frame: SubscribedFrame)
pub async fn get_view_sort_config(&self, view: &str) -> Option<SortConfig>
pub async fn set_view_sort_config(&self, view: &str, config: SortConfig)
Trait Implementations§
Auto Trait Implementations§
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