This reference describes unreleased code on main; no release documents it yet.

rlmesh::env::RemoteEnv

structPreviewuse rlmesh::env::RemoteEnv;[source]

A client for one remote env.

struct RemoteEnv

Construction dials and handshakes; the env’s exclusive session slot is taken by the first reset, step or render. Calls block (each has an _async twin); &mut self serializes them. Dropping an unclosed client closes it with close’s bound.

Also available as rlmesh::RemoteEnv.

Associated functions

Methods

new

associated function[source]
fn new(options: RemoteEnvOptions) -> Result<RemoteEnv>

Dial and handshake. Invalid options are the ValueError class, a dial failure the ConnectionError class, a refused handshake the ProtocolException class; an endpoint with more than one env is refused.

new_async

associated function[source]
async fn new_async(options: RemoteEnvOptions) -> Result<RemoteEnv>

The async twin of new.

address

method[source]
fn address(&self) -> &str

The canonical connect string of the dialed endpoint.

env_id

method[source]
fn env_id(&self) -> &str

This connection’s container id (UUIDv7), distinct from the human env name (env_contract().id()).

selected_workflow_edition

method[source]
fn selected_workflow_edition(&self) -> &str

The workflow edition this connection negotiated, or the last edition a session pinned it to.

env_contract

method[source]
fn env_contract(&self) -> &EnvContract

The contract the server reported at handshake.

render_mode

method[source]
fn render_mode(&self) -> Option<&str>

The env’s render mode, if any.

metadata

method[source]
fn metadata(&self) -> &Metadata

The endpoint’s metadata (empty when it reports none).

observation_space_spec

method[source]
fn observation_space_spec(&self) -> &SpaceSpec

The observation space spec reported by the endpoint.

action_space_spec

method[source]
fn action_space_spec(&self) -> &SpaceSpec

The action space spec reported by the endpoint.

cancel_handle

method[source]
fn cancel_handle(&self) -> CancelToken

This handle’s cancel token: firing it fails the call in flight, or the next call.

render

method[source]
fn render(&mut self, env_index: Option<u64>) -> Result<Option<Value>>

Render lane env_index (None = 0) as a uint8 frame, or None when the env has no frame.

render_async

method[source]
async fn render_async(
    &mut self,
    env_index: Option<u64>,
) -> Result<Option<Value>>

The async twin of render.

close

method[source]
fn close(&mut self) -> Result<()>

Close this client’s session (idempotent); the server keeps running. Errors other than a lost connection or an expired bound are returned.

close_async

method[source]
async fn close_async(&mut self) -> Result<()>

The async twin of close.

shutdown

method[source]
fn shutdown(&mut self, reason: Option<&str>) -> Result<bool>

Ask the server to shut itself down (None = "owner shutdown"); true when it accepted, which closes this client.

shutdown_async

method[source]
async fn shutdown_async(&mut self, reason: Option<&str>) -> Result<bool>

The async twin of shutdown.

observation_space

method[source]
fn observation_space(&self) -> &Space

The observation space (built once).

action_space

method[source]
fn action_space(&self) -> &Space

The action space (built once).

reset

method[source]
fn reset(
    &mut self,
    seed: Option<i64>,
    options: Option<&InfoDict>,
) -> Result<(Value, InfoDict)>

Start an episode: (observation, info). info carries the runtime-reserved episode_ids.

reset_async

method[source]
async fn reset_async(
    &mut self,
    seed: Option<i64>,
    options: Option<&InfoDict>,
) -> Result<(Value, InfoDict)>

The async twin of reset.

step

method[source]
fn step(
    &mut self,
    action: Value,
) -> Result<(Value, f64, bool, bool, InfoDict)>

Apply one action: (observation, reward, terminated, truncated, info); info carries episode_ids and completed_episodes.

step_async

method[source]
async fn step_async(
    &mut self,
    action: Value,
) -> Result<(Value, f64, bool, bool, InfoDict)>

The async twin of step.

Trait implementations

  • impl Drop for RemoteEnv
  • impl Debug for RemoteEnv
  • impl<'a> From<&'a mut RemoteEnv> for EnvTarget<'a>