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 !RefUnwindSafe for MaterializedView
impl !UnwindSafe for MaterializedView
impl Forget for MaterializedView
impl Freeze for MaterializedViewwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<RwLock<HashSet<String>>> is !null: Freeze,
PhantomData<ArcInner<RwLock<HashSet<String>>>>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for MaterializedView
impl Send for MaterializedView
impl Sync for MaterializedView
impl Unpin for MaterializedView
impl UnsafeUnpin for MaterializedViewwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<RwLock<HashSet<String>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<HashSet<String>>>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
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