Skip to main content

RuntimeEnv

Trait RuntimeEnv 

Source
pub trait RuntimeEnv: Send {
    // Required methods
    fn reset<'life0, 'async_trait>(
        &'life0 mut self,
        request: ResetRequest,
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeEnvReset, RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn step<'life0, 'async_trait>(
        &'life0 mut self,
        request: StepRequest,
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeEnvStep, RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
        _timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

The environment side of a route: reset and step over the wire, plus close.

The driver holds one clone per group (a lane endpoint is driven with one request per lane in flight), so an implementation is a handle onto the env session: clones share the session and multiplex their requests.

Required Methods§

Source

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

Reset the requested lanes and return their initial observation.

Source

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

Advance the lanes one step under request.action.

Provided Methods§

Source

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

Release the env endpoint within timeout. Default no-op for an endpoint the run does not own.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§