Skip to main content

Crate icedwright_protocol

Crate icedwright_protocol 

Source
Expand description

Wire types for icedwright.

  • raw: the raw tree a live app records, which icedwright_semantics::infer turns into a semantic tree. The harness and the remote endpoint produce the same values.
  • The typed remote protocol: one type per request, each tied to its response type and method name through Request, the handshake (Hello, Welcome, PROTOCOL and accepts), Notifications, WireEvent and the framing in WireFrame.

Geometry and roles come from icedwright-types. Nothing here depends on a JSON library: both ends encode with serde_json, and values only the app can rebuild travel as JSON text.

Re-exports§

pub use raw::AnnotationSource;
pub use raw::RawAnnotation;
pub use raw::RawCall;
pub use raw::RawKey;
pub use raw::RawNode;
pub use raw::RawTree;
pub use raw::RawValue;
pub use raw::RawWindow;
pub use raw::RawWindowInfo;
pub use raw::WidgetId;
pub use raw::WindowId;

Modules§

raw
The raw tree a live app records: every operation callback as a node, in call order, with annotations carried as owned data. icedwright_semantics::infer turns it into a semantic tree.

Structs§

Attachment
The attachment a JSON frame announces; the binary frame follows it immediately.
Bye
Ends the session; the probe releases every window and rule the client held.
Call
A request in its envelope. Built with Call::new, which takes the method from the request type.
CursorReading
The cursor kind one layer was handed during a delivery.
Delivered
The answer to Input.
Done
The response to requests that only succeed or fail. Serialises as null.
Drive
Takes control of a window’s input; real input is dropped while held.
ErrorBody
The body of an error reply.
Focus
Asks the probe to give a window focus.
FrameCount
Rises on every redraw.
Generation
Rises whenever the app handles a message or the probe delivers an event.
Guard
What the client decided on before sending a guarded input.
Hello
The first request on a connection.
HoldTask
Holds every task of a name until released.
Input
Input events for one window.
Inspect
Turns the inspector’s pick mode on or off; picks arrive as Hovered notifications.
NextTask
Waits for the next task of a name.
Record
Turns recording of real events on or off; they arrive as Observed notifications.
Release
Gives a window’s input back.
ReleaseTask
Lets a held task run.
RemoveRule
Removes a rule.
Reply
A reply in its envelope: { "id": n, "result": .. } or { "id": n, "error": .. }.
RequestId
Chosen by the client; a reply carries its request’s id.
ResolveTask
Completes a held task without running it.
Screenshot
Asks for a window’s pixels.
ScreenshotHeader
The answer to Screenshot; the RGBA bytes follow as an attachment.
Snapshot
Asks for the raw tree. With after, a long poll answered once the generation passes it.
VersionMismatch
The peer speaks a different major version.
WaitIdle
Answered once no named task is in flight and the probe has no input, collection or guarded request outstanding.
Welcome
The answer to Hello.
WindowList
The answer to Windows.
WindowOrdinal
A window on the wire, numbered in order of first appearance.
Windows
Asks for the open windows.
WireDuration
A real-time duration on the wire, in whole milliseconds.
WireFrame
One frame.
WireModifiers
The modifiers held.
WireRuleId
A task rule the client installed.
WireTaskId
A named task the probe is tracking.

Enums§

AnyRequest
Any request, for the probe’s dispatch. A match on it is exhaustive, so a request cannot be added without a handler.
AnyResponse
The response to any request, named by the request it answers. Serialises as the response itself.
ErrorCode
What an error reply says went wrong.
FrameKind
What a frame’s payload holds.
Notification
What the probe pushes unasked. Notifications carry event and no id.
ProtocolError
Framing, JSON and version errors, and error replies from the peer.
ReplyBody
A result or an error.
SnapshotReply
The answer to Snapshot.
TaskChange
What a named task did.
TaskOutput
What a resolved task completes with, as JSON text the probe deserialises into the task’s output type.
WireButton
A mouse button.
WireEvent
One input event.
WireKey
A logical key.
WireLocation
Where a key is on the keyboard.
WirePhysicalKey
A physical key.
WireScrollDelta
How far a scroll moved.
WireStatus
What the widgets did with an event.

Constants§

HEADER_LEN
Bytes before the payload.
MAX_FRAME_BYTES
The largest payload either end accepts.
METHODS
Every method name, in declaration order.
PROTOCOL
(major, minor). Minor bumps only add optional fields; a different major cannot talk.

Traits§

Request
A request type, tied to its response type and method name, so a client cannot send one request and read another’s answer. Sealed: the list of requests is this crate’s.

Functions§

accepts
Checks the peer’s version from the handshake: the same major is accepted whatever the minor.