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

rlmesh::specs::EnvContract

structPreviewuse rlmesh::specs::EnvContract;[source]

The contract an env endpoint serves.

struct EnvContract

Only the library builds one (an EnvServer derives it from the env; a remote client reads it from the handshake). Clones are independent values.

Also available as rlmesh::EnvContract.

id

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

The env id ("UnknownEnv-v1" when the env sets none).

observation_space

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

The space one observation belongs to.

action_space

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

The space one action belongs to.

render_mode

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

The env’s render mode, if any.

num_envs

method[source]
fn num_envs(&self) -> u64

The number of lanes the endpoint serves.

metadata

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

The env’s metadata, tags included, if any.

env

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

The env alias: a copy of this contract.

spec

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

The spec alias: a copy of this contract.

to_dict

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

A dictionary containing id, render_mode, num_envs, metadata, and each space as {kind, shape, dtype, details}.

Trait implementations

  • impl Clone for EnvContract
  • impl Display for EnvContract
  • impl Debug for EnvContract