pub struct Crystal { /* private fields */ }Expand description
The Crystal — a collection of tiles persisted on disk.
Implementations§
Source§impl Crystal
impl Crystal
Sourcepub fn crystallize(
&mut self,
content: &str,
salience: SalienceMap,
) -> Result<TileId>
pub fn crystallize( &mut self, content: &str, salience: SalienceMap, ) -> Result<TileId>
Crystallize content into a new tile.
Sourcepub fn recall(&self, tile_id: &TileId, context: &str) -> Result<Reconstruction>
pub fn recall(&self, tile_id: &TileId, context: &str) -> Result<Reconstruction>
Recall a specific tile with context-dependent reconstruction.
Sourcepub fn recall_collective(
&self,
query: &str,
limit: usize,
) -> Result<Vec<Reconstruction>>
pub fn recall_collective( &self, query: &str, limit: usize, ) -> Result<Vec<Reconstruction>>
Recall multiple tiles matching a query.
Sourcepub fn forget(&mut self, older_than: Duration) -> Result<usize>
pub fn forget(&mut self, older_than: Duration) -> Result<usize>
Forget tiles older than the given duration (using decay schedule).
Sourcepub fn reconsolidate(
&mut self,
tile_id: &TileId,
new_context: &str,
) -> Result<()>
pub fn reconsolidate( &mut self, tile_id: &TileId, new_context: &str, ) -> Result<()>
Reconsolidate a tile: update it with new context, resetting decay.
Sourcepub fn stats(&self) -> CrystalStats
pub fn stats(&self) -> CrystalStats
Get stats about the crystal.
Auto Trait Implementations§
impl Freeze for Crystal
impl RefUnwindSafe for Crystal
impl Send for Crystal
impl Sync for Crystal
impl Unpin for Crystal
impl UnsafeUnpin for Crystal
impl UnwindSafe for Crystal
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