pub struct MaterializedViewManager { /* private fields */ }Expand description
Materialized view manager
Implementations§
Source§impl MaterializedViewManager
impl MaterializedViewManager
Sourcepub fn create_view(
&mut self,
name: String,
query: Vec<Predicate>,
ttl: Option<Duration>,
) -> Result<(), String>
pub fn create_view( &mut self, name: String, query: Vec<Predicate>, ttl: Option<Duration>, ) -> Result<(), String>
Create a materialized view
Sourcepub fn refresh_view(
&mut self,
name: &str,
results: Vec<Vec<Term>>,
) -> Result<(), String>
pub fn refresh_view( &mut self, name: &str, results: Vec<Vec<Term>>, ) -> Result<(), String>
Refresh a view with new results
Sourcepub fn find_matching_view(
&mut self,
query: &[Predicate],
) -> Option<&mut MaterializedView>
pub fn find_matching_view( &mut self, query: &[Predicate], ) -> Option<&mut MaterializedView>
Find a view that matches the query
Sourcepub fn get_view(&self, name: &str) -> Option<&MaterializedView>
pub fn get_view(&self, name: &str) -> Option<&MaterializedView>
Get a view by name
Sourcepub fn get_view_mut(&mut self, name: &str) -> Option<&mut MaterializedView>
pub fn get_view_mut(&mut self, name: &str) -> Option<&mut MaterializedView>
Get a mutable view by name
Sourcepub fn all_views(&self) -> &HashMap<String, MaterializedView>
pub fn all_views(&self) -> &HashMap<String, MaterializedView>
Get all views
Sourcepub fn cleanup_stale_views(&mut self)
pub fn cleanup_stale_views(&mut self)
Clean up stale views (based on TTL and access count)
Sourcepub fn get_statistics(&self) -> ViewStatistics
pub fn get_statistics(&self) -> ViewStatistics
Get view usage statistics
Sourcepub fn set_min_access_threshold(&mut self, threshold: usize)
pub fn set_min_access_threshold(&mut self, threshold: usize)
Set minimum access threshold for view retention
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MaterializedViewManager
impl RefUnwindSafe for MaterializedViewManager
impl Send for MaterializedViewManager
impl Sync for MaterializedViewManager
impl Unpin for MaterializedViewManager
impl UnwindSafe for MaterializedViewManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more