Skip to navigation

Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

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>> { ... }
}

Referenced types: Send, Sync, RunRecord, Pin, Box, Future, Result, (), str, Option, ExecutionPlan, Vec, TrieEnvelope, AccumulatorState, PromptIR, StabilityAnalysisResult

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>>

Referenced types: RunRecord, Pin, Box, Future, Result, (), Send

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>>

Referenced types: str, Pin, Box, Future, Result, Option, ExecutionPlan, Send

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>>

Referenced types: str, Pin, Box, Future, Result, Vec, RunRecord, Send

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>>

Referenced types: str, TrieEnvelope, Pin, Box, Future, Result, (), Send

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>>

Referenced types: str, Pin, Box, Future, Result, Option, TrieEnvelope, Send

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>>

Referenced types: str, AccumulatorState, Pin, Box, Future, Result, (), Send

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>>

Referenced types: str, Pin, Box, Future, Result, Option, AccumulatorState, Send

Load trie accumulator state for an agent.

Provided Methods

store_plan

fn store_plan(&self, _plan: &ExecutionPlan) -> Result<()>

Referenced types: 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>>

Referenced types: str, PromptIR, Pin, Box, Future, Result, (), Send

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>>

Referenced types: str, Pin, Box, Future, Result, Option, Vec, PromptIR, Send

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>>

Referenced types: str, StabilityAnalysisResult, Pin, Box, Future, Result, (), Send

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>>

Referenced types: str, Pin, Box, Future, Result, Option, StabilityAnalysisResult, Send

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

Referenced types: StorageBackendDyn, RedisBackend

impl StorageBackendDyn for InMemoryBackend

impl StorageBackendDyn for InMemoryBackend

Referenced types: StorageBackendDyn, InMemoryBackend