Expand description
Snapcast binary protocol implementation.
This crate implements the Snapcast binary wire protocol, providing serialization and deserialization for all message types exchanged between snapclient and snapserver.
§Protocol Overview
Every message consists of a BaseMessage header followed by a typed payload.
All multi-byte integers are little-endian.
See the protocol documentation for the full specification.
Re-exports§
pub use message::MessageType;pub use message::base::BaseMessage;pub use message::base::ProtoError;pub use sample_format::SampleFormat;pub use types::Timeval;
Modules§
- message
- Protocol message types.
- sample_
format - Audio sample format description.
- status
- Snapcast status types matching the JSON-RPC wire format.
- types
- Shared types used across the protocol.
Constants§
- CODEC_
F32L Z4 - Lossless f32 LZ4 codec name.
- CODEC_
F32L Z4_ ENCRYPTED_ ALIAS - Encrypted f32 LZ4 command-line/config alias.
- CODEC_
FLAC - FLAC codec name.
- CODEC_
OGG - Ogg/Vorbis codec name as used on the Snapcast wire.
- CODEC_
OPUS - Opus codec name.
- CODEC_
PCM - Raw PCM codec name.
- DEFAULT_
BIND_ ADDRESS - Default TCP bind address for server listeners.
- DEFAULT_
BUFFER_ MS - Default playout buffer size in milliseconds.
- DEFAULT_
CLIENT_ NAME - Default client display name.
- DEFAULT_
CONTROL_ PORT - Default TCP port for JSON-RPC control.
- DEFAULT_
ENCRYPTION_ PSK - Default pre-shared key for f32lz4e (encrypted f32lz4) codec.
- DEFAULT_
HTTP_ PORT - Default HTTP port for JSON-RPC + Snapweb.
- DEFAULT_
MAX_ PAYLOAD_ SIZE - Maximum accepted binary protocol payload size.
- DEFAULT_
MDNS_ SERVICE_ TYPE - Default mDNS service type for Snapcast discovery.
- DEFAULT_
SAMPLE_ FORMAT - Default sample format: 48000 Hz, 16-bit, stereo.
- DEFAULT_
SAMPLE_ FORMAT_ STRING - Default sample format string used by config files and command-line defaults.
- DEFAULT_
SERVER_ NAME - Default server display name.
- DEFAULT_
STREAM_ PORT - Default TCP port for binary protocol (streaming clients).
- DEFAULT_
WSS_ PORT - Default WebSocket Secure port.
- PCM_
24BIT_ MAX - Maximum absolute value of a 24-bit signed integer sample (2^23 - 1).
- PROTOCOL_
VERSION - Snapcast binary protocol version.
- SCHEME_
TCP - Plain TCP streaming transport scheme.
- SCHEME_
WS - WebSocket streaming transport scheme.
- SCHEME_
WSS - WebSocket-over-TLS streaming transport scheme.