pub trait RuntimeStore:
Send
+ Sync
+ 'static {
// Required methods
fn load(
&self,
project_id: &str,
session_id: &str,
) -> Result<Option<RuntimeSnapshot>, RuntimeError>;
fn save(
&self,
project_id: &str,
session_id: &str,
snapshot: &RuntimeSnapshot,
) -> Result<(), RuntimeError>;
// Provided methods
fn save_release(
&self,
_release: &RuntimeRelease,
) -> Result<(), RuntimeError> { ... }
fn load_release(
&self,
_project_id: &str,
_version: u64,
) -> Result<Option<RuntimeRelease>, RuntimeError> { ... }
fn list_releases(
&self,
_project_id: &str,
) -> Result<Vec<RuntimeRelease>, RuntimeError> { ... }
fn active_release(
&self,
_project_id: &str,
) -> Result<Option<u64>, RuntimeError> { ... }
fn set_active_release(
&self,
_project_id: &str,
_version: u64,
) -> Result<(), RuntimeError> { ... }
fn save_local_provider_binding(
&self,
_project_id: &str,
_binding: &LocalProviderBinding,
) -> Result<(), RuntimeError> { ... }
fn local_provider_bindings(
&self,
_project_id: &str,
) -> Result<Vec<LocalProviderBinding>, RuntimeError> { ... }
fn enqueue_trace(
&self,
_trace: &RuntimeTraceRecord,
) -> Result<(), RuntimeError> { ... }
fn pending_traces(
&self,
_limit: usize,
) -> Result<Vec<RuntimeTraceRecord>, RuntimeError> { ... }
fn acknowledge_traces(
&self,
_trace_ids: &[String],
) -> Result<(), RuntimeError> { ... }
}Expand description
Persistence adapter supplied by an embedding host.
The default MemoryRuntimeStore keeps session state in memory. Server
deployments can implement this trait with their database adapter.
Required Methods§
fn load( &self, project_id: &str, session_id: &str, ) -> Result<Option<RuntimeSnapshot>, RuntimeError>
fn save( &self, project_id: &str, session_id: &str, snapshot: &RuntimeSnapshot, ) -> Result<(), RuntimeError>
Provided Methods§
fn save_release(&self, _release: &RuntimeRelease) -> Result<(), RuntimeError>
fn load_release( &self, _project_id: &str, _version: u64, ) -> Result<Option<RuntimeRelease>, RuntimeError>
fn list_releases( &self, _project_id: &str, ) -> Result<Vec<RuntimeRelease>, RuntimeError>
fn active_release(&self, _project_id: &str) -> Result<Option<u64>, RuntimeError>
fn set_active_release( &self, _project_id: &str, _version: u64, ) -> Result<(), RuntimeError>
fn save_local_provider_binding( &self, _project_id: &str, _binding: &LocalProviderBinding, ) -> Result<(), RuntimeError>
fn local_provider_bindings( &self, _project_id: &str, ) -> Result<Vec<LocalProviderBinding>, RuntimeError>
fn enqueue_trace(&self, _trace: &RuntimeTraceRecord) -> Result<(), RuntimeError>
fn pending_traces( &self, _limit: usize, ) -> Result<Vec<RuntimeTraceRecord>, RuntimeError>
fn acknowledge_traces(&self, _trace_ids: &[String]) -> Result<(), RuntimeError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".