rlmesh::env::RemoteEnv
A client for one remote env.
struct RemoteEnvConstruction 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
- address()The canonical connect string of the dialed endpoint.
- env_id()This connection's container id (UUIDv7), distinct from the human env name (
env_contract().id()). - selected_workflow_edition()The workflow edition this connection negotiated, or the last edition a session pinned it to.
- env_contract()The contract the server reported at handshake.
- render_mode()The env's render mode, if any.
- metadata()The endpoint's metadata (empty when it reports none).
- observation_space_spec()The observation space spec reported by the endpoint.
- action_space_spec()The action space spec reported by the endpoint.
- cancel_handle()This handle's cancel token: firing it fails the call in flight, or the next call.
- render()Render lane
env_index(None= 0) as a uint8 frame, orNonewhen the env has no frame. - render_async()The async twin of
render. - close()Close this client's session (idempotent); the server keeps running.
- close_async()The async twin of
close. - shutdown()Ask the server to shut itself down (
None="owner shutdown"); true when it accepted, which closes this client. - shutdown_async()The async twin of
shutdown. - observation_space()The observation space (built once).
- action_space()The action space (built once).
- reset()Start an episode:
(observation, info). - reset_async()The async twin of
reset. - step()Apply one action:
(observation, reward, terminated, truncated, info);infocarriesepisode_idsandcompleted_episodes. - step_async()The async twin of
step.
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) -> &strThe canonical connect string of the dialed endpoint.
env_id
method[source]fn env_id(&self) -> &strThis connection’s container id (UUIDv7), distinct from the
human env name (env_contract().id()).
selected_workflow_edition
method[source]fn selected_workflow_edition(&self) -> &strThe workflow edition this connection negotiated, or the last edition a session pinned it to.
env_contract
method[source]fn env_contract(&self) -> &EnvContractThe 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) -> &MetadataThe endpoint’s metadata (empty when it reports none).
observation_space_spec
method[source]fn observation_space_spec(&self) -> &SpaceSpecThe observation space spec reported by the endpoint.
action_space_spec
method[source]fn action_space_spec(&self) -> &SpaceSpecThe action space spec reported by the endpoint.
cancel_handle
method[source]fn cancel_handle(&self) -> CancelTokenThis 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) -> &SpaceThe observation space (built once).
action_space
method[source]fn action_space(&self) -> &SpaceThe 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>