Skip to main content

Crate pushwire_server

Crate pushwire_server 

Source
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§

binary
channel
delta
fragments
relay
rtc
transport
types

Structs§

BinaryFlags
Flags describing frame properties.
BinaryFrame
Binary frame format: [magic:2][version:1][flags:1][channel:1][sequence:4][payload:var]
CompressionConfig
Compression options for encoding/decoding.
CompressionDictionary
Pre-trained zstd dictionary with a numeric ID.
FragmentAssembler
Assembles fragments keyed by fragment_id until all parts arrive.
FragmentRetention
Retention/cleanup policy for fragments.
FragmentShard
Frame
Envelope for multiplexed frames. Payloads are intentionally generic so downstream services can attach their own typed content.
PayloadDelta
Delta against a base cursor for content payloads.
PushServer
Generic multiplexed push server parameterized by channel type.
RtcRouter
TurnCredential

Enums§

AuthError
BinaryEnvelope
Envelope for binary assets delivered over the push channel.
BinaryError
DeltaApplyResult
DeltaError
DeltaOp
FragmentError
PayloadEncoding
Encoding used for the payload body.
RtcMessage
RTC signaling messages carried on the rtc channel.
SendError
Errors that can occur when pushing frames to a connected client.
SystemOp
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§

ChannelKind
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§

AuthValidator
Auth validation callback invoked during the initial handshake.
ChannelHandler
Callback invoked for each inbound frame on a non-system channel.
RawPayload