Skip to main content

Crate arora_bridge

Crate arora_bridge 

Source
Expand description

The Arora Bridge interface.

A Bridge connects an Arora runtime to a remote — in practice Semio Studio over studio-bridge. It is modelled on studio-bridge’s device-client trait: push local state changes out, receive device-info updates and commands in, and learn when a client is asking for data.

§The seam: an owned inbound stream, a non-blocking outbound push

A Bridge value is an endpoint: the connection as seen by exactly one device, owned by exactly one runtime. Its data plane is two methods:

  • take_inbound hands over the endpoint’s inbound event stream — once, at assembly. The runtime owns the stream from then on and polls it from its own loop (natively run’s select drains it between steps; on the web the per-frame sweep does). The stream ending means the endpoint disconnected; the runtime maps that explicitly, it is never silent.
  • try_send pushes an outbound StateChange toward the remote, now, without blocking (a channel send / synchronous put).

Exclusive ownership is the point: one poller per endpoint, so there is no shared receiver and no lock anywhere on the data plane. An implementation whose transport genuinely serves several devices (one Zenoh session, one WebSocket server) keeps that transport in a shared core and hands out one endpoint per device, demuxing inbound events to the right endpoint’s stream — share the core, not the endpoint.

The trait depends on futures-core (for Stream) but on no async runtime: native impls may feed the stream from their own tokio task, web impls from browser events; the runtime only polls.

The trait lives here (lean: arora-types + stream primitives) so the runtime can depend on the interface without depending on studio-bridge. studio-bridge keeps its device-client implementations and implements this trait on them.

Structs§

AccessRequest
A remote client asking permission to interact with the device — e.g. a Studio client wanting to join the device’s session (Studio’s “session joining access control”).
BridgeCommand
A command received from the remote, carrying a one-shot reply channel.
DeviceInfo
Neutral device metadata the bridge syncs with the remote. The bridge-flavored wire form (studio-bridge’s PartialDeviceInfo) is converted to/from this by the connector.
FakeBridge
A no-op Bridge for tests and offline runs: never registers, never emits inbound events (its stream never yields — the endpoint never disconnects), and accepts (drops) any data sent.

Enums§

AccessDecision
The device operator’s answer to an AccessRequest.
BridgeError
Something went wrong on the bridge.
BridgeOp
An operation a remote client asks the device to perform. Mirrors studio-bridge’s AroraOp.
Inbound
An inbound event on a bridge endpoint, yielded by the stream Bridge::take_inbound hands over.

Traits§

Bridge
One device’s connection to a remote (e.g. Semio Studio) — an endpoint, owned by exactly one runtime.
Caller
The client side of calling a device — the counterpart of a Bridge endpoint: carry a fully-specified Call to a device and resolve on its reply. A device applies external calls at a step boundary, so calling is asynchronous by nature wherever the device lives — in the same process or across a transport.

Type Aliases§

AccessRequestStream
Stream of access requests from remote clients.
BridgeResult
CallFuture
A Caller’s pending reply.
InboundStream
The inbound event stream of one bridge endpoint. Owned: whoever takes it is the endpoint’s one poller. The stream ending means the endpoint disconnected.