pub trait NodeStore: Send + Sync {
Show 15 methods
// Required methods
fn query_nodes_async<'life0, 'async_trait>(
&'life0 self,
query: NodeQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_node_async<'life0, 'async_trait>(
&'life0 self,
node: SttpNode,
) -> Pin<Box<dyn Future<Output = Result<NodeUpsertResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_by_resonance_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life2 [String]>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_by_resonance_global_async<'life0, 'life1, 'async_trait>(
&'life0 self,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life1 [String]>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_nodes_async<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: usize,
session_id: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_last_avec_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AvecState>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_trigger_history_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn store_calibration_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
avec: AvecState,
trigger: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn query_changes_since_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
cursor: Option<SyncCursor>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<ChangeQueryResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_checkpoint_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
connector_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SyncCheckpoint>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn put_checkpoint_async<'life0, 'async_trait>(
&'life0 self,
checkpoint: SyncCheckpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn batch_rekey_scopes_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_ids: Vec<String>,
target_tenant_id: &'life1 str,
target_session_id: &'life2 str,
dry_run: bool,
allow_merge: bool,
) -> Pin<Box<dyn Future<Output = Result<BatchRekeyResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn store_async<'life0, 'async_trait>(
&'life0 self,
node: SttpNode,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_by_hybrid_async<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life2 [String]>,
query_embedding: Option<&'life3 [f32]>,
alpha: f32,
beta: f32,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn get_by_hybrid_global_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life1 [String]>,
query_embedding: Option<&'life2 [f32]>,
alpha: f32,
beta: f32,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Storage abstraction for STTP nodes and calibration data.
Implementors are expected to preserve semantics across both in-memory and persistent backends.
Required Methods§
Sourcefn query_nodes_async<'life0, 'async_trait>(
&'life0 self,
query: NodeQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_nodes_async<'life0, 'async_trait>(
&'life0 self,
query: NodeQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query nodes with optional session and time filters.
Sourcefn upsert_node_async<'life0, 'async_trait>(
&'life0 self,
node: SttpNode,
) -> Pin<Box<dyn Future<Output = Result<NodeUpsertResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_node_async<'life0, 'async_trait>(
&'life0 self,
node: SttpNode,
) -> Pin<Box<dyn Future<Output = Result<NodeUpsertResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Idempotently persist a parsed node using its deterministic sync key.
Sourcefn get_by_resonance_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life2 [String]>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_by_resonance_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life2 [String]>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve nodes ordered by resonance to the provided AVEC state.
Sourcefn get_by_resonance_global_async<'life0, 'life1, 'async_trait>(
&'life0 self,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life1 [String]>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_by_resonance_global_async<'life0, 'life1, 'async_trait>(
&'life0 self,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life1 [String]>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve nodes ordered by resonance across all sessions.
Sourcefn list_nodes_async<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: usize,
session_id: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_nodes_async<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: usize,
session_id: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List recent nodes with an optional session filter.
Sourcefn get_last_avec_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AvecState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_last_avec_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AvecState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the most recent calibration AVEC for a session.
Sourcefn get_trigger_history_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_trigger_history_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read calibration trigger history for a session.
Sourcefn store_calibration_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
avec: AvecState,
trigger: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store_calibration_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
avec: AvecState,
trigger: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a new calibration measurement for a session.
Sourcefn query_changes_since_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
cursor: Option<SyncCursor>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<ChangeQueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_changes_since_async<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
cursor: Option<SyncCursor>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<ChangeQueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query nodes that changed after the provided cursor.
Sourcefn get_checkpoint_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
connector_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SyncCheckpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_checkpoint_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
connector_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SyncCheckpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Read the last sync checkpoint for a connector within a session scope.
Sourcefn put_checkpoint_async<'life0, 'async_trait>(
&'life0 self,
checkpoint: SyncCheckpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_checkpoint_async<'life0, 'async_trait>(
&'life0 self,
checkpoint: SyncCheckpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the last sync checkpoint for a connector within a session scope.
Sourcefn batch_rekey_scopes_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_ids: Vec<String>,
target_tenant_id: &'life1 str,
target_session_id: &'life2 str,
dry_run: bool,
allow_merge: bool,
) -> Pin<Box<dyn Future<Output = Result<BatchRekeyResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn batch_rekey_scopes_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_ids: Vec<String>,
target_tenant_id: &'life1 str,
target_session_id: &'life2 str,
dry_run: bool,
allow_merge: bool,
) -> Pin<Box<dyn Future<Output = Result<BatchRekeyResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Batch-rekey one or more source scopes to a target scope using node IDs as anchors.
Implementations should treat node_ids as source-scope anchors and apply scope-wide
updates across all related tables, not just the anchor records themselves.
Provided Methods§
Sourcefn store_async<'life0, 'async_trait>(
&'life0 self,
node: SttpNode,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_async<'life0, 'async_trait>(
&'life0 self,
node: SttpNode,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist a parsed node and return its storage identifier.
Sourcefn get_by_hybrid_async<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life2 [String]>,
query_embedding: Option<&'life3 [f32]>,
alpha: f32,
beta: f32,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_by_hybrid_async<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life2 [String]>,
query_embedding: Option<&'life3 [f32]>,
alpha: f32,
beta: f32,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Retrieve nodes using blended AVEC resonance and semantic similarity.
This is additive and backward-compatible with resonance-only callers. Implementations should gracefully fall back to AVEC-only ranking when embeddings are unavailable.
Sourcefn get_by_hybrid_global_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life1 [String]>,
query_embedding: Option<&'life2 [f32]>,
alpha: f32,
beta: f32,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_by_hybrid_global_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
current_avec: AvecState,
from_utc: Option<DateTime<Utc>>,
to_utc: Option<DateTime<Utc>>,
tiers: Option<&'life1 [String]>,
query_embedding: Option<&'life2 [f32]>,
alpha: f32,
beta: f32,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SttpNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve nodes using blended AVEC resonance and semantic similarity across all sessions.