Trait Storage Backend Dyn
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.
Required Methods
store_run_dyn
fn store_run_dyn<'a>(
&'a self,
record: &'a RunRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Persist one observed run.
load_plan_dyn
fn 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_dyn
fn 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_trie
fn 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_trie
fn 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_accumulators
fn 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_accumulators
fn 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.
Provided Methods
store_plan
fn store_plan(&self, _plan: &ExecutionPlan) -> Result<()>
Persist an execution plan for an agent.
Notes
The default implementation is a no-op for backends that do not persist plans.
store_observations
fn 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.
Notes
The default implementation is a no-op.
load_observations
fn 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.
Notes
The default implementation returns Ok(None).
store_stability
fn 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.
Notes
The default implementation is a no-op.
load_stability
fn 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.
Notes
The default implementation returns Ok(None).
Implementors
impl StorageBackendDyn for RedisBackend
impl StorageBackendDyn for RedisBackend
impl StorageBackendDyn for InMemoryBackend
impl StorageBackendDyn for InMemoryBackend