pub struct WatchManager { /* private fields */ }Expand description
Manages watch subscriptions for change polling.
Implementations§
Source§impl WatchManager
impl WatchManager
Sourcepub fn subscribe(
&self,
username: &str,
ids: Vec<String>,
graph_version: u64,
) -> Result<String, String>
pub fn subscribe( &self, username: &str, ids: Vec<String>, graph_version: u64, ) -> Result<String, String>
Subscribe to changes on a set of entity IDs.
Sourcepub fn poll(
&self,
watch_id: &str,
username: &str,
graph: &SharedGraph,
) -> Option<Vec<HDict>>
pub fn poll( &self, watch_id: &str, username: &str, graph: &SharedGraph, ) -> Option<Vec<HDict>>
Poll for changes since the last poll.
Sourcepub fn unsubscribe(&self, watch_id: &str, username: &str) -> bool
pub fn unsubscribe(&self, watch_id: &str, username: &str) -> bool
Unsubscribe a watch by ID.
Sourcepub fn add_ids(&self, watch_id: &str, username: &str, ids: Vec<String>) -> bool
pub fn add_ids(&self, watch_id: &str, username: &str, ids: Vec<String>) -> bool
Add entity IDs to an existing watch.
Sourcepub fn remove_ids(&self, watch_id: &str, username: &str, ids: &[String]) -> bool
pub fn remove_ids(&self, watch_id: &str, username: &str, ids: &[String]) -> bool
Remove specific entity IDs from an existing watch.
Sourcepub fn remove_by_owner(&self, owner: &str)
pub fn remove_by_owner(&self, owner: &str)
Remove all watches owned by a given user.
Sourcepub fn get_ids(&self, watch_id: &str) -> Option<Vec<String>>
pub fn get_ids(&self, watch_id: &str) -> Option<Vec<String>>
Return the list of entity IDs for a given watch.
Sourcepub fn encode_cached(
&self,
ref_val: &str,
graph_version: u64,
entity: &HDict,
) -> Value
pub fn encode_cached( &self, ref_val: &str, graph_version: u64, entity: &HDict, ) -> Value
Encode an entity using the cache.
Sourcepub fn all_watched_ids(&self) -> HashSet<String>
pub fn all_watched_ids(&self) -> HashSet<String>
Get the IDs of all entities watched by any watch.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WatchManager
impl !RefUnwindSafe for WatchManager
impl Send for WatchManager
impl Sync for WatchManager
impl Unpin for WatchManager
impl UnsafeUnpin for WatchManager
impl UnwindSafe for WatchManager
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