Struct exocore_store::local::EntityIndex[][src]

pub struct EntityIndex<CS, PS> where
    CS: ChainStore,
    PS: PendingStore
{ /* fields omitted */ }
Expand description

Manages and index entities and their traits stored in the chain and pending store of the chain layer. The index accepts mutations from the chain layer through its event stream, and manages both indices to be consistent.

The chain index is persisted on disk, while the pending store index is an in-memory index. Since the persistence in the chain is not definitive until blocks and their operations (entity mutations) are stored at a certain depth, a part of the chain is actually indexed in the in-memory index. Once they reach a certain depth, they are persisted in the chain index.

Implementations

Opens or create an entities index

Handles events coming from the chain layer. These events allow keeping the index consistent with the chain layer, up to the consistency guarantees that the layer offers. Returns operations that have been involved and the number of index operations applied.

Since the events stream is buffered, we may receive a discontinuity if the chain layer couldn’t send us an event. In that case, we re-index the pending index since we can’t guarantee that we didn’t lose an event.

Executes a search query on the indices, and returning all entities matching the query.

Calls the garbage collector to run a pass on entities that got flagged and generates deletion mutations.

Fetches indexed mutations metadata from pending and chain indices for this entity id and aggregate them.

Fetches indexed mutations metadata from pending and chain indices for this entity id.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.