chore: bootstrap nana-story M0

This commit is contained in:
Codex
2026-07-28 12:51:00 +08:00
commit 3dacc92423
71 changed files with 6840 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
[package]
name = "nana-store"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[dependencies]
nana-domain.workspace = true
thiserror.workspace = true
[lints]
workspace = true
+20
View File
@@ -0,0 +1,20 @@
use nana_domain::{RuntimeState, StoryNode};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum StoreError {
#[error("story not found: {0}")]
StoryNotFound(String),
#[error("storage backend is not initialized")]
NotInitialized,
}
pub trait StoryStore: Send + Sync {
fn append_node(&self, node: &StoryNode, state: &RuntimeState) -> Result<(), StoreError>;
fn load_state(
&self,
story_id: &str,
branch_id: &str,
) -> Result<RuntimeState, StoreError>;
}