Skip to main content

Crate pushwire_client

Crate pushwire_client 

Source
Expand description

push-wire-client — generic multiplexed push client.

Provides PushClient parameterized by ChannelKind, with WebSocket and SSE transports, cursor tracking, automatic reconnection with resume, and channel-based message dispatch via ChannelReceiver.

Re-exports§

pub use connection::TransportPreference;
pub use cursor::CursorTracker;
pub use dispatch::ChannelReceiver;
pub use reconnect::ReconnectPolicy;
pub use session::ClientConfig;
pub use session::ConnectError;
pub use session::ConnectionState;
pub use session::PushClient;
pub use session::SendError;

Modules§

auth
Authentication handshake logic.
binary
channel
connection
cursor
delta
dispatch
fragments
reconnect
rtc
session
subscription
Channel subscription management.
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.
RtcRouter
TurnCredential

Enums§

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

RawPayload