pub struct EntityCacheHandle<'a> { /* private fields */ }Expand description
Handle for refreshing the entity cache from upstream canonical state.
This is intentionally NOT the full EntityRegistry API — it only exposes
cache-refresh operations to enforce non-authoritative semantics. The entity
registry is a derived projection that can be rebuilt without data loss.
Implementations§
Source§impl<'a> EntityCacheHandle<'a>
impl<'a> EntityCacheHandle<'a>
Sourcepub fn from_registry_mut(registry: &'a mut EntityRegistry) -> Self
pub fn from_registry_mut(registry: &'a mut EntityRegistry) -> Self
Create a cache handle from a mutable reference to an entity registry.
This is useful for testing or when the caller already has a mutable
reference to an EntityRegistry (e.g., outside the runtime context).
In normal runtime usage, prefer KnowledgeRuntime::refresh_entity_cache().
Sourcepub fn load_from_upstream(&mut self, entity: Entity) -> Result<(), RuntimeError>
pub fn load_from_upstream(&mut self, entity: Entity) -> Result<(), RuntimeError>
Load an entity from upstream canonical state into the cache.
This registers (or updates) an entity in the derived cache.
The entity data should originate from an upstream canonical source
(e.g., semantic-memory entity_aliases table).
Sourcepub fn clear_scope(&mut self, scope: &ScopeKey)
pub fn clear_scope(&mut self, scope: &ScopeKey)
Clear all cached entities in a scope (for targeted rebuild).