Skip to main content

RawGraphStore

Trait RawGraphStore 

Source
pub trait RawGraphStore: Send + Sync {
    // Required methods
    async fn save_graph(
        &self,
        id: &str,
        goal: &str,
        status: &str,
        graph_json: &str,
        created_at: &str,
        finished_at: Option<&str>,
    ) -> Result<(), MemoryError>;
    async fn load_graph(&self, id: &str) -> Result<Option<String>, MemoryError>;
    async fn list_graphs(
        &self,
        limit: u32,
    ) -> Result<Vec<GraphSummary>, MemoryError>;
    async fn delete_graph(&self, id: &str) -> Result<bool, MemoryError>;
}
Expand description

Raw persistence interface for task graphs.

All graph data is stored as a JSON blob. The orchestration layer in zeph-core is responsible for serializing/deserializing TaskGraph.

Required Methods§

Source

async fn save_graph( &self, id: &str, goal: &str, status: &str, graph_json: &str, created_at: &str, finished_at: Option<&str>, ) -> Result<(), MemoryError>

Persist a graph (upsert by id).

§Errors

Returns a MemoryError on database failure.

Source

async fn load_graph(&self, id: &str) -> Result<Option<String>, MemoryError>

Load a graph by its string UUID.

Returns None if the graph does not exist.

§Errors

Returns a MemoryError on database failure.

Source

async fn list_graphs( &self, limit: u32, ) -> Result<Vec<GraphSummary>, MemoryError>

List graphs ordered by created_at descending, limited to limit rows.

§Errors

Returns a MemoryError on database failure.

Source

async fn delete_graph(&self, id: &str) -> Result<bool, MemoryError>

Delete a graph by its string UUID.

Returns true if a row was deleted.

§Errors

Returns a MemoryError on database failure.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§