pub struct MaterializedView {
pub name: String,
pub query: Vec<Predicate>,
pub results: Vec<Vec<Term>>,
pub last_refresh: SystemTime,
pub ttl: Option<Duration>,
pub access_count: usize,
pub total_cost_saved: f64,
}Expand description
Materialized view metadata
Fields§
§name: StringUnique view name
query: Vec<Predicate>Query pattern that defines this view
results: Vec<Vec<Term>>Precomputed results
last_refresh: SystemTimeTime when the view was created/refreshed
ttl: Option<Duration>Time-to-live before refresh needed
access_count: usizeStatistics about view usage
total_cost_saved: f64Total cost saved by using this view
Implementations§
Source§impl MaterializedView
impl MaterializedView
Sourcepub fn needs_refresh(&self) -> bool
pub fn needs_refresh(&self) -> bool
Check if view needs refresh based on TTL
Sourcepub fn record_access(&mut self, cost_saved: f64)
pub fn record_access(&mut self, cost_saved: f64)
Record a view access
Sourcepub fn matches_query(&self, query: &[Predicate]) -> bool
pub fn matches_query(&self, query: &[Predicate]) -> bool
Check if query matches this view
Trait Implementations§
Source§impl Clone for MaterializedView
impl Clone for MaterializedView
Source§fn clone(&self) -> MaterializedView
fn clone(&self) -> MaterializedView
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MaterializedView
impl Debug for MaterializedView
Source§impl<'de> Deserialize<'de> for MaterializedView
impl<'de> Deserialize<'de> for MaterializedView
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MaterializedView
impl RefUnwindSafe for MaterializedView
impl Send for MaterializedView
impl Sync for MaterializedView
impl Unpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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