Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.
pub trait StorageBackendDyn:
Send
+ Sync
+ 'static {
// Required methods
fn store_run_dyn<'a>(
&'a self,
record: &'a RunRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
fn load_plan_dyn<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<ExecutionPlan>>> + Send + 'a>>;
fn list_runs_dyn<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunRecord>>> + Send + 'a>>;
fn store_trie<'a>(
&'a self,
agent_id: &'a str,
envelope: &'a TrieEnvelope,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
fn load_trie<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TrieEnvelope>>> + Send + 'a>>;
fn store_accumulators<'a>(
&'a self,
agent_id: &'a str,
state: &'a AccumulatorState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
fn load_accumulators<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<AccumulatorState>>> + Send + 'a>>;
// Provided methods
fn store_plan(&self, _plan: &ExecutionPlan) -> Result<()> { ... }
fn store_observations<'a>(
&'a self,
_agent_id: &'a str,
_observations: &'a [PromptIR],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>> { ... }
fn load_observations<'a>(
&'a self,
_agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<PromptIR>>>> + Send + 'a>> { ... }
fn store_stability<'a>(
&'a self,
_agent_id: &'a str,
_result: &'a StabilityAnalysisResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>> { ... }
fn load_stability<'a>(
&'a self,
_agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<StabilityAnalysisResult>>> + Send + 'a>> { ... }
}
Object-safe storage interface used by the adaptive runtime.
Backends implement this trait when they need to be stored behind trait objects and accessed through dynamic dispatch.
store_run_dynfn store_run_dyn<'a>(
&'a self,
record: &'a RunRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Persist one observed run.
load_plan_dynfn load_plan_dyn<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<ExecutionPlan>>> + Send + 'a>>
Load the current execution plan for an agent.
list_runs_dynfn list_runs_dyn<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunRecord>>> + Send + 'a>>
List stored runs for an agent.
store_triefn store_trie<'a>(
&'a self,
agent_id: &'a str,
envelope: &'a TrieEnvelope,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Persist a serialized prediction trie for an agent.
load_triefn load_trie<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TrieEnvelope>>> + Send + 'a>>
Load the serialized prediction trie for an agent.
store_accumulatorsfn store_accumulators<'a>(
&'a self,
agent_id: &'a str,
state: &'a AccumulatorState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Persist trie accumulator state for an agent.
load_accumulatorsfn load_accumulators<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<AccumulatorState>>> + Send + 'a>>
Load trie accumulator state for an agent.
store_planfn store_plan(&self, _plan: &ExecutionPlan) -> Result<()>
Persist an execution plan for an agent.
The default implementation is a no-op for backends that do not persist plans.
store_observationsfn store_observations<'a>(
&'a self,
_agent_id: &'a str,
_observations: &'a [PromptIR],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Persist prompt IR observations for an agent or derived Adaptive Cache Governor (ACG) profile.
The default implementation is a no-op.
load_observationsfn load_observations<'a>(
&'a self,
_agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<PromptIR>>>> + Send + 'a>>
Load prompt IR observations for an agent or derived Adaptive Cache Governor (ACG) profile.
The default implementation returns Ok(None).
store_stabilityfn store_stability<'a>(
&'a self,
_agent_id: &'a str,
_result: &'a StabilityAnalysisResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Persist an ACG stability result for an agent or derived profile.
The default implementation is a no-op.
load_stabilityfn load_stability<'a>(
&'a self,
_agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<StabilityAnalysisResult>>> + Send + 'a>>
Load an ACG stability result for an agent or derived profile.
The default implementation returns Ok(None).
impl StorageBackendDyn for RedisBackendimpl StorageBackendDyn for RedisBackend
impl StorageBackendDyn for InMemoryBackendimpl StorageBackendDyn for InMemoryBackend