pub struct ViewEngine { /* private fields */ }Expand description
Engine for building and querying persistent views.
Views are defined as Rust closures (map functions). The engine incrementally updates indexes by reading the changes feed since the last known sequence.
Implementations§
Source§impl ViewEngine
impl ViewEngine
pub fn new() -> Self
Sourcepub fn register_map<F>(&mut self, ddoc: &str, view_name: &str, f: F)
pub fn register_map<F>(&mut self, ddoc: &str, view_name: &str, f: F)
Register a Rust map function for a design doc view.
Sourcepub async fn update_index(
&mut self,
adapter: &dyn Adapter,
ddoc: &str,
view_name: &str,
) -> Result<()>
pub async fn update_index( &mut self, adapter: &dyn Adapter, ddoc: &str, view_name: &str, ) -> Result<()>
Update a view index by fetching changes since the last known seq.
Sourcepub fn get_index(
&self,
ddoc: &str,
view_name: &str,
) -> Option<&PersistentViewIndex>
pub fn get_index( &self, ddoc: &str, view_name: &str, ) -> Option<&PersistentViewIndex>
Get a view index by ddoc/view_name.
Sourcepub fn index_names(&self) -> Vec<String>
pub fn index_names(&self) -> Vec<String>
Get all registered index names.
Sourcepub fn remove_indexes_not_in(&mut self, valid: &HashSet<String>)
pub fn remove_indexes_not_in(&mut self, valid: &HashSet<String>)
Remove indexes not in the given set of valid names.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ViewEngine
impl !RefUnwindSafe for ViewEngine
impl Send for ViewEngine
impl Sync for ViewEngine
impl Unpin for ViewEngine
impl !UnwindSafe for ViewEngine
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