pub struct MaterializedView {
pub id: String,
pub source_id: String,
/* private fields */
}Expand description
A materialized view that tracks a subset of entities based on a pipeline
Fields§
§id: StringView identifier
source_id: StringSource view/entity this derives from
Implementations§
Source§impl MaterializedView
impl MaterializedView
Sourcepub fn new(id: String, source_id: String, pipeline: ViewPipeline) -> Self
pub fn new(id: String, source_id: String, pipeline: ViewPipeline) -> Self
Create a new materialized view
Sourcepub async fn evaluate_initial(
&self,
cache: &EntityCache,
) -> Vec<(String, Value)>
pub async fn evaluate_initial( &self, cache: &EntityCache, ) -> Vec<(String, Value)>
Evaluate initial state from cache
Sourcepub async fn compute_effect(
&self,
key: &str,
new_value: Option<&Value>,
_cache: &EntityCache,
) -> ViewEffect
pub async fn compute_effect( &self, key: &str, new_value: Option<&Value>, _cache: &EntityCache, ) -> ViewEffect
Determine the effect of an entity update on this view
Sourcepub async fn apply_effect(&self, effect: &ViewEffect)
pub async fn apply_effect(&self, effect: &ViewEffect)
Apply an effect to update the current keys
Trait Implementations§
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