Skip to main content

Crate node_device_session

Crate node_device_session 

Source
Expand description

Shared device-session server (C-5): transport-neutral /econ-v1/device-session/1.

Carriers implement SessionStreams + HostBus and call serve. Pass WebRtcSignaling when the carrier can answer webrtc.signal/1 (iroh); otherwise that method is refused with unsupported_transport. Iroh-specific pieces (QUIC ProtocolHandler, WebRTC media path, session registry/push) stay in node-app-iroh.

Modules§

caps
Capability names the host bus is expected to map.

Structs§

IngressSocket
Host-owned Unix socket that alone may attest device-session provenance.
OpenOk
Proven session identity after a successful session.open/1.
Refusal
A host refusal the device is allowed to see (code + public detail).
Session
Verified (or renewed) session identity returned by the host bus.

Enums§

FrameError
Errors from encoding/decoding a request frame.
OpenMode
Session mode after a successful open.
ResponseError
Errors from decoding a response frame.
SessionEnd
Why crate::serve returned.
SessionPath
How the session reached the node (stamped on the ingress).

Constants§

ALPN
ALPN for /econ-v1/device-session/1.
DEVICE_CALL_METHOD
A device calls a node service.
HTTP_REQUEST_METHOD
One HTTP request on an authenticated session stream.
MAX_FRAME_BYTES
Maximum size of a single wire frame.
PATH_HEADER
Path header stamped on every attested upstream request.
RESPONSE_STATUS_ERR
Response status: error.
RESPONSE_STATUS_OK
Response status: success.
SESSION_HEADER
Provenance header stamped on every attested upstream request.
SESSION_OPEN_METHOD
First stream: {credential} or {mode:renewal}.
SESSION_RENEW_METHOD
One-shot first stream: {} → a new credential, then connection close.
WEBRTC_SIGNAL_METHOD
WebRTC signaling on an authenticated session stream.
WS_STREAM_METHOD
A live WebSocket bridge on an authenticated session stream.

Traits§

HostBus
The app’s bus to the host for device-session capabilities.
SessionStreams
One authenticated peer connection (handshake already proved Self::peer_key).
WebRtcSignaling
Carrier-owned WebRTC signaling for webrtc.signal/1.

Functions§

decode_request
Decode a request frame, borrowing the payload.
decode_response
Decode a response frame.
encode_http_tunnel_request
Encode an http.request/1 body for tests and carriers.
encode_request
Encode [u16 BE method_len][method][payload].
encode_response
Encode [u8 status][body].
peek_method
Read only the method prefix; payload stays unread.
serve
Serve one authenticated peer connection until it ends.

Type Aliases§

BoxRecv
Boxed read half of one bidirectional stream.
BoxSend
Boxed write half of one bidirectional stream.