pub struct ViewMaterializer { /* private fields */ }Expand description
Caches and manages materialized views by name.
Each view is associated with an optional predicate dependency list. When a triple with a tracked predicate changes, the affected views are marked stale and must be re-materialized.
Implementations§
Source§impl ViewMaterializer
impl ViewMaterializer
pub fn new() -> Self
Sourcepub fn register_graph_view(&mut self, view: GraphView, predicates: Vec<String>)
pub fn register_graph_view(&mut self, view: GraphView, predicates: Vec<String>)
Register a GraphView under its name.
Sourcepub fn get_graph_view(&self, name: &str) -> Option<&GraphView>
pub fn get_graph_view(&self, name: &str) -> Option<&GraphView>
Retrieve a registered graph view by name.
Sourcepub fn mark_stale_for_predicates(
&mut self,
changed_predicates: &[String],
) -> Vec<String>
pub fn mark_stale_for_predicates( &mut self, changed_predicates: &[String], ) -> Vec<String>
Mark all views that depend on any of the given predicates as stale.
Sourcepub fn refresh_view(&mut self, name: &str, fresh_triples: Vec<RdfTriple>)
pub fn refresh_view(&mut self, name: &str, fresh_triples: Vec<RdfTriple>)
Re-materialize a stale view with fresh triple data.
Sourcepub fn stale_views(&self) -> Vec<&str>
pub fn stale_views(&self) -> Vec<&str>
All stale view names.
Trait Implementations§
Source§impl Debug for ViewMaterializer
impl Debug for ViewMaterializer
Source§impl Default for ViewMaterializer
impl Default for ViewMaterializer
Source§fn default() -> ViewMaterializer
fn default() -> ViewMaterializer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ViewMaterializer
impl RefUnwindSafe for ViewMaterializer
impl Send for ViewMaterializer
impl Sync for ViewMaterializer
impl Unpin for ViewMaterializer
impl UnsafeUnpin for ViewMaterializer
impl UnwindSafe for ViewMaterializer
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