Skip to main content

TileStore

Struct TileStore 

Source
pub struct TileStore { /* private fields */ }
Expand description

Immutable tile store with versioning and cascade

Implementations§

Source§

impl TileStore

Source

pub fn new() -> Self

Source

pub fn insert(&mut self, version: TileVersion)

Insert a new tile (version 1)

Source

pub fn insert_version(&mut self, version: TileVersion) -> Result<(), String>

Insert a new version of an existing tile

Source

pub fn get_latest(&self, tile_id: &str) -> Option<&TileVersion>

Get the latest version of a tile

Source

pub fn get_version(&self, tile_id: &str, version: u32) -> Option<&TileVersion>

Get a specific version of a tile

Source

pub fn get_history(&self, tile_id: &str) -> Vec<&TileVersion>

Get all versions of a tile (newest first)

Source

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)

Source

pub fn add_dependency( &mut self, dependent_id: &str, dependency_id: &str, strength: f32, )

Add a dependency relationship

Source

pub fn get_dependents(&self, tile_id: &str) -> Vec<&Dependency>

Get all tiles that depend on the given tile

Source

pub fn get_dependencies_of(&self, tile_id: &str) -> Vec<&Dependency>

Get all tiles that the given tile depends on

Source

pub fn invalidate( &mut self, tile_id: &str, reason: &str, now: u64, ) -> CascadeEvent

Invalidate a tile and cascade to dependents (OLMo’s insight)

Source

pub fn restore(&mut self, tile_id: &str, now: u64) -> Result<(), String>

Restore a previously invalidated tile

Source

pub fn search_by_tag(&self, tag: &str) -> Vec<&TileVersion>

Search tiles by tag

Source

pub fn get_cascade_log(&self) -> &[CascadeEvent]

Get cascade history

Source

pub fn tile_count(&self) -> usize

Count of tiles

Source

pub fn total_versions(&self) -> usize

Total versions across all tiles

Source

pub fn tile_ids(&self) -> Vec<String>

List all tile IDs

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.