Expand description
push-wire-server — generic multiplexed push server.
Provides PushServer parameterized by ChannelKind, with WebSocket
and SSE transports, cursor-based replay, priority queuing, and rate limiting.
Channel-specific handling is registered by the consumer, not built in.
Re-exports§
pub use relay::RelayBandwidth;pub use relay::RelayController;pub use relay::RelayOutcome;pub use transport::ModeSwitchReason;pub use transport::ModeSwitchSignal;pub use transport::RouteOutcome;pub use transport::TransportDispatcher;pub use transport::TransportError;pub use transport::TransportManager;pub use transport::TransportMode;pub use transport::TransportPacket;pub use transport::TransportRoute;
Modules§
Structs§
- Binary
Flags - Flags describing frame properties.
- Binary
Frame - Binary frame format:
[magic:2][version:1][flags:1][channel:1][sequence:4][payload:var] - Compression
Config - Compression options for encoding/decoding.
- Compression
Dictionary - Pre-trained zstd dictionary with a numeric ID.
- Fragment
Assembler - Assembles fragments keyed by fragment_id until all parts arrive.
- Fragment
Retention - Retention/cleanup policy for fragments.
- Fragment
Shard - Frame
- Envelope for multiplexed frames. Payloads are intentionally generic so downstream services can attach their own typed content.
- Payload
Delta - Delta against a base cursor for content payloads.
- Push
Server - Generic multiplexed push server parameterized by channel type.
- RtcRouter
- Turn
Credential
Enums§
- Auth
Error - Binary
Envelope - Envelope for binary assets delivered over the push channel.
- Binary
Error - Delta
Apply Result - Delta
Error - DeltaOp
- Fragment
Error - Payload
Encoding - Encoding used for the payload body.
- RtcMessage
- RTC signaling messages carried on the
rtcchannel. - Send
Error - Errors that can occur when pushing frames to a connected client.
- System
Op - System control plane messages that travel on the system channel.
Constants§
- FRAGMENT_
HEADER_ LEN - Header: [fragment_id:16][total:2][index:2]
- MAGIC_
HEADER - Magic bytes prefixing every binary frame (“RP”).
- VERSION_
BYTE - Version byte for future evolution.
Traits§
- Channel
Kind - Trait for defining multiplexed channel types.
Functions§
- apply_
delta - Apply a delta on the client. If the base cursor does not match or the delta is empty, it signals full sync.
- compute_
delta - Compute a naive delta that replaces the tree when the content differs.
- decode_
frame - Decode a frame without any pre-shared dictionaries.
- decode_
frame_ with_ dictionaries - Decode a frame using a set of pre-shared dictionaries.
- encode_
frame - Encode without compression using the default settings.
- encode_
frame_ with_ compression - Encode with optional per-frame compression.
- parse_
channels - Parse a comma-separated channel list (e.g. from SSE query params).
- train_
dictionary - Train a zstd dictionary from samples.
Type Aliases§
- Auth
Validator - Auth validation callback invoked during the initial handshake.
- Channel
Handler - Callback invoked for each inbound frame on a non-system channel.
- RawPayload