pub struct MaterializedView {
pub definition: ViewDefinition,
pub rows: Vec<ViewRow>,
pub last_updated_ms: i64,
pub version: u64,
pub is_stale: bool,
}Expand description
The cached result set of a named SPARQL view.
last_updated_ms is a Unix timestamp in milliseconds; version is
incremented every time the view is refreshed.
Fields§
§definition: ViewDefinitionThe definition that drives this view.
rows: Vec<ViewRow>Cached result rows.
last_updated_ms: i64Unix timestamp (ms) when the view was last refreshed.
version: u64Monotonically increasing refresh counter.
is_stale: boolWhether the cached rows are out-of-date.
Implementations§
Source§impl MaterializedView
impl MaterializedView
Sourcepub fn new(definition: ViewDefinition, initial_rows: Vec<ViewRow>) -> Self
pub fn new(definition: ViewDefinition, initial_rows: Vec<ViewRow>) -> Self
Create a new MaterializedView with the given initial rows.
last_updated_ms is set to the current wall-clock time and version
starts at 0.
Sourcepub fn refresh(&mut self, new_rows: Vec<ViewRow>)
pub fn refresh(&mut self, new_rows: Vec<ViewRow>)
Replace the current rows with new_rows, clear the stale flag, and
bump version.
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Mark the view as stale (i.e. its cached rows need to be recomputed).
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