pushwire-core 0.1.1

Shared types and codecs for push-wire multiplexed push protocol
Documentation
# pushwire-core

Shared types and codecs for the [pushwire](https://crates.io/crates/pushwire) multiplexed push protocol.

## What's inside

| Module | Description |
|--------|-------------|
| `channel` | `ChannelKind` trait — implement this to define your own channel taxonomy |
| `types` | `Frame<C>`, `SystemOp<C>`, `BinaryEnvelope` — wire types parameterized by channel |
| `binary` | Binary codec: `[magic:2][version:1][flags:1][channel:1][sequence:4][payload]` with MessagePack/CBOR encoding and zstd compression |
| `delta` | SHA-256 gated incremental updates — `compute_delta` / `apply_delta` |
| `fragments` | `FragmentAssembler` for splitting and reassembling large payloads |
| `rtc` | WebRTC signaling types and `RtcRouter` deduplication (behind `rtc` feature) |

## Usage

```rust
use pushwire_core::{ChannelKind, Frame, SystemOp};
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
enum MyChannel { Chat, System }

impl ChannelKind for MyChannel {
    fn priority(&self) -> u8 { 0 }
    fn wire_id(&self) -> u8 { match self { Self::Chat => 1, Self::System => 5 } }
    fn from_wire_id(id: u8) -> Option<Self> { match id { 1 => Some(Self::Chat), 5 => Some(Self::System), _ => None } }
    fn from_name(s: &str) -> Option<Self> { match s { "chat" => Some(Self::Chat), "system" => Some(Self::System), _ => None } }
    fn name(&self) -> &'static str { match self { Self::Chat => "chat", Self::System => "system" } }
    fn is_system(&self) -> bool { matches!(self, Self::System) }
    fn all() -> &'static [Self] { &[Self::Chat, Self::System] }
}

let frame: Frame<MyChannel> = Frame::new(MyChannel::Chat, serde_json::json!({"msg": "hello"}));
```

## Features

- **`rtc`** (default) — enables WebRTC signaling types (`RtcMessage`, `RtcRouter`, `TurnCredential`)

## License

Apache-2.0