pub struct ReactiveQueryState { /* private fields */ }Expand description
Tracks the current state of a reactive query
Implementations§
Source§impl ReactiveQueryState
impl ReactiveQueryState
pub fn new<F>(filter: F) -> Self
Sourcepub async fn add_if_matches(&self, doc: Document) -> Option<QueryUpdate>
pub async fn add_if_matches(&self, doc: Document) -> Option<QueryUpdate>
Add a document to results if it matches
Sourcepub async fn remove(&self, id: &str) -> Option<QueryUpdate>
pub async fn remove(&self, id: &str) -> Option<QueryUpdate>
Remove a document from results
Sourcepub async fn update(&self, id: &str, new_doc: Document) -> Option<QueryUpdate>
pub async fn update(&self, id: &str, new_doc: Document) -> Option<QueryUpdate>
Update a document, checking if it should be added/removed/modified
Sourcepub async fn get_results(&self) -> Vec<Document>
pub async fn get_results(&self) -> Vec<Document>
Get current results as a Vec
Auto Trait Implementations§
impl Freeze for ReactiveQueryState
impl !RefUnwindSafe for ReactiveQueryState
impl Send for ReactiveQueryState
impl Sync for ReactiveQueryState
impl Unpin for ReactiveQueryState
impl !UnwindSafe for ReactiveQueryState
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