pub struct TileStore { /* private fields */ }Expand description
Immutable tile store with versioning and cascade
Implementations§
Source§impl TileStore
impl TileStore
pub fn new() -> Self
Sourcepub fn insert(&mut self, version: TileVersion)
pub fn insert(&mut self, version: TileVersion)
Insert a new tile (version 1)
Sourcepub fn insert_version(&mut self, version: TileVersion) -> Result<(), String>
pub fn insert_version(&mut self, version: TileVersion) -> Result<(), String>
Insert a new version of an existing tile
Sourcepub fn get_latest(&self, tile_id: &str) -> Option<&TileVersion>
pub fn get_latest(&self, tile_id: &str) -> Option<&TileVersion>
Get the latest version of a tile
Sourcepub fn get_version(&self, tile_id: &str, version: u32) -> Option<&TileVersion>
pub fn get_version(&self, tile_id: &str, version: u32) -> Option<&TileVersion>
Get a specific version of a tile
Sourcepub fn get_history(&self, tile_id: &str) -> Vec<&TileVersion>
pub fn get_history(&self, tile_id: &str) -> Vec<&TileVersion>
Get all versions of a tile (newest first)
Sourcepub fn rollback(
&mut self,
tile_id: &str,
target_version: u32,
now: u64,
) -> Result<TileVersion, String>
pub fn rollback( &mut self, tile_id: &str, target_version: u32, now: u64, ) -> Result<TileVersion, String>
Rollback a tile to a specific version Creates a new version with the old content (immutable — doesn’t delete)
Sourcepub fn add_dependency(
&mut self,
dependent_id: &str,
dependency_id: &str,
strength: f32,
)
pub fn add_dependency( &mut self, dependent_id: &str, dependency_id: &str, strength: f32, )
Add a dependency relationship
Sourcepub fn get_dependents(&self, tile_id: &str) -> Vec<&Dependency>
pub fn get_dependents(&self, tile_id: &str) -> Vec<&Dependency>
Get all tiles that depend on the given tile
Sourcepub fn get_dependencies_of(&self, tile_id: &str) -> Vec<&Dependency>
pub fn get_dependencies_of(&self, tile_id: &str) -> Vec<&Dependency>
Get all tiles that the given tile depends on
Sourcepub fn invalidate(
&mut self,
tile_id: &str,
reason: &str,
now: u64,
) -> CascadeEvent
pub fn invalidate( &mut self, tile_id: &str, reason: &str, now: u64, ) -> CascadeEvent
Invalidate a tile and cascade to dependents (OLMo’s insight)
Sourcepub fn restore(&mut self, tile_id: &str, now: u64) -> Result<(), String>
pub fn restore(&mut self, tile_id: &str, now: u64) -> Result<(), String>
Restore a previously invalidated tile
Sourcepub fn search_by_tag(&self, tag: &str) -> Vec<&TileVersion>
pub fn search_by_tag(&self, tag: &str) -> Vec<&TileVersion>
Search tiles by tag
Sourcepub fn get_cascade_log(&self) -> &[CascadeEvent]
pub fn get_cascade_log(&self) -> &[CascadeEvent]
Get cascade history
Sourcepub fn tile_count(&self) -> usize
pub fn tile_count(&self) -> usize
Count of tiles
Sourcepub fn total_versions(&self) -> usize
pub fn total_versions(&self) -> usize
Total versions across all tiles
Auto Trait Implementations§
impl Freeze for TileStore
impl RefUnwindSafe for TileStore
impl Send for TileStore
impl Sync for TileStore
impl Unpin for TileStore
impl UnsafeUnpin for TileStore
impl UnwindSafe for TileStore
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