Skip to main content

GraphStore

Trait GraphStore 

Source
pub trait GraphStore: Send + Sync {
    // Required methods
    fn insert_edge<'life0, 'life1, 'async_trait>(
        &'life0 self,
        edge: &'life1 TemporalEdge,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn close_edge<'life0, 'async_trait>(
        &'life0 self,
        edge_id: Uuid,
        closed_at: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn outgoing_at<'life0, 'async_trait>(
        &'life0 self,
        node: Uuid,
        as_of: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TemporalEdge>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn all_edges<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TemporalEdge>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Persistent home for TemporalEdge rows.

Today the only impl is duckdb::DuckGraphStore. The trait stays minimal on purpose — we add methods only when retrieval needs them rather than guessing.

Required Methods§

Source

fn insert_edge<'life0, 'life1, 'async_trait>( &'life0 self, edge: &'life1 TemporalEdge, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist edge (or upsert if edge.id already exists).

Source

fn close_edge<'life0, 'async_trait>( &'life0 self, edge_id: Uuid, closed_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close the validity window of edge_id at closed_at — i.e. “as of this moment we no longer believe the relation is true”. Idempotent: closing an already-closed edge no-ops.

Source

fn outgoing_at<'life0, 'async_trait>( &'life0 self, node: Uuid, as_of: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<TemporalEdge>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Edges leaving node that are valid at as_of. Used by the BFS in crate::graph_expand.

Source

fn all_edges<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<TemporalEdge>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every edge in the store — for tests and admin tooling. Not suitable for hot-path retrieval; production walkers should stick to [outgoing_at].

Implementors§