Skip to main content

Crate oxframe_preview

Crate oxframe_preview 

Source
Expand description

Preview protocol for oxframe.

Status: oxframe is under very active development. The API is not stable yet and may change from version to version. Pin the exact version in your Cargo.toml and check the changelog before upgrading.

Session implements the editor protocol (oxframe-protocol) on top of any PreviewEngine and is independent of the transport:

  • natively, server exposes it over a WebSocket on 127.0.0.1 (frames are JPEG-encoded and cached);
  • in the browser, the same session runs inside wasm and frames go to a canvas as raw RGBA.

Modules§

server
Native preview server: WebSocket on 127.0.0.1, protocol JSON for commands/events, binary frames (16-byte header + JPEG).

Structs§

Session
Transport-independent preview state machine: feed it Commands, send its Outputs to the UI.

Enums§

MetaEdit
An edit of a scene’s meta.json requested by the editor.
Output
A message for the UI: JSON event or binary frame.

Traits§

PreviewEngine
What the preview needs from an engine, on top of drawing frames (FrameSource). Implemented by oxframe::PreviewAdapter.

Functions§

rgba_encoder
Raw RGBA “encoding” (in-process transports, tests).

Type Aliases§

Encoder
Encodes a rendered frame for the wire.