pub struct MaterializedView {
pub definition: ViewDefinition,
pub rows: Vec<HashMap<String, String>>,
pub row_count: usize,
pub last_updated: Instant,
pub update_count: u64,
pub is_stale: bool,
}Expand description
The current materialized state of a SPARQL view.
Each row is a variable binding map {variable_name → value}.
Fields§
§definition: ViewDefinitionDefinition driving this view.
rows: Vec<HashMap<String, String>>Cached result rows.
row_count: usizeSnapshot of rows.len() for quick access.
last_updated: InstantWhen the view data was last refreshed.
update_count: u64Cumulative number of times this view has been refreshed.
is_stale: boolWhether the view needs to be re-evaluated before it can be used.
Implementations§
Source§impl MaterializedView
impl MaterializedView
Sourcepub fn new(
definition: ViewDefinition,
initial_rows: Vec<HashMap<String, String>>,
) -> Self
pub fn new( definition: ViewDefinition, initial_rows: Vec<HashMap<String, String>>, ) -> Self
Construct a new MaterializedView from a definition and an initial result set.
Sourcepub fn apply_deltas(&mut self, deltas: &[TripleDelta]) -> bool
pub fn apply_deltas(&mut self, deltas: &[TripleDelta]) -> bool
Apply a batch of deltas, marking this view stale if any delta affects it.
Returns true if the view was newly marked stale by this call.
Sourcepub fn is_affected_by(&self, delta: &TripleDelta) -> bool
pub fn is_affected_by(&self, delta: &TripleDelta) -> bool
Return true if delta could affect this view’s result set.
A view is considered affected when:
- Its
accessed_predicateslist is empty (depends on everything), or - The delta’s predicate appears in
accessed_predicates.
Auto Trait Implementations§
impl Freeze for MaterializedView
impl RefUnwindSafe for MaterializedView
impl Send for MaterializedView
impl Sync for MaterializedView
impl Unpin for MaterializedView
impl UnsafeUnpin for MaterializedView
impl UnwindSafe for MaterializedView
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