Expand description
RYO Storage - Persistent storage and transaction log
This crate provides:
- Storage: Session persistence and replay
- TxLog: Transaction logging for undo/redo and replay
§Architecture
┌─────────────────────────────────────────────────────────────────────────┐
│ Layer 1: Mutation (Functional Layer) │
│ - trait Mutation { apply(), describe(), ... } │
└─────────────────────────────────────────────────────────────────────────┘
↓ generates at execution time
┌─────────────────────────────────────────────────────────────────────────┐
│ Layer 2: MutationRecord (Recording Layer) │
│ - Serializable record of each mutation │
│ - Contains: MutationSpec + StateRef(pre) + StateRef(post) │
└─────────────────────────────────────────────────────────────────────────┘
↓ references
┌─────────────────────────────────────────────────────────────────────────┐
│ Layer 3: StateStore (State Layer) │
│ - Content-addressed storage for file states │
│ - Immutable: StateRef = hash of content │
└─────────────────────────────────────────────────────────────────────────┘§Usage
ⓘ
use ryo_storage::{RyoStorage, TxLog, TxLogger};
// Create storage
let mut storage = RyoStorage::global()?;
storage.ensure_init()?;
// Start logging
let logger = TxLogger::start(project_path, file_count);
logger.log_mutation("Rename", "foo → bar", 3);
let log = logger.finish();
// Save session
let session_id = storage.dump(&log)?;
// Load and replay
let loaded = storage.load(&session_id)?;Re-exports§
pub use storage::AutoSaveLogger;pub use storage::CliConfig;pub use storage::ConfigError;pub use storage::Format;pub use storage::FormatError;pub use storage::FormatResult;pub use storage::GlobalConfig;pub use storage::ProjectIndex;pub use storage::ProjectMeta;pub use storage::RyoStorage;pub use storage::ServerConfig;pub use storage::SessionFormat;pub use storage::SessionIndex;pub use storage::SessionMeta;pub use storage::StateRef;pub use storage::StateStore;pub use storage::StorageError;pub use storage::StorageResult;pub use storage::TxLogMode;pub use txlog::MutationRecord;pub use txlog::ReplayAnalysis;pub use txlog::ReplayEngine;pub use txlog::ReplayError;pub use txlog::ReplayMode;pub use txlog::ReplayResult;pub use txlog::TxAction;pub use txlog::TxEntry;pub use txlog::TxLog;pub use txlog::TxLogger;pub use txlog::TxSummary;pub use uuid_storage::FileUuidStorage;
Modules§
- storage
- Global RYO storage for session persistence and replay.
- txlog
- TxLog: Replayable Transaction Log for Ryo
- uuid_
storage - File-based UUID persistence implementation.