Skip to main content

RuntimeModel

Trait RuntimeModel 

Source
pub trait RuntimeModel: Send {
    // Required method
    fn predict<'life0, 'async_trait>(
        &'life0 mut self,
        request: PredictRequest,
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeModelPrediction, RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn reset_adapter<'life0, 'async_trait>(
        &'life0 mut self,
        _request: ResetAdapterRequest,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn release_adapter<'life0, 'async_trait>(
        &'life0 mut self,
        _request: ReleaseAdapterRequest,
        _timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

The model side of a route: predict, plus the per-episode adapter-state lifecycle (evict on episode end, release at session end).

Required Methods§

Source

fn predict<'life0, 'async_trait>( &'life0 mut self, request: PredictRequest, ) -> Pin<Box<dyn Future<Output = Result<RuntimeModelPrediction, RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Predict the ordered action frames for the batched observation (frame 0 is this step; any further frames replay open-loop before the next call).

Provided Methods§

Source

fn reset_adapter<'life0, 'async_trait>( &'life0 mut self, _request: ResetAdapterRequest, ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Evict the model’s per-episode adapter state (frame-stack buffers) for the ended episodes. Best-effort GC, not a correctness gate: because episode ids never repeat (UUIDv7), a dropped ResetAdapter only leaks memory and can never alias a new episode. Default no-op for impls that hold no per-episode state.

Source

fn release_adapter<'life0, 'async_trait>( &'life0 mut self, _request: ReleaseAdapterRequest, _timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Release the model endpoint within timeout. Default no-op.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§