16 stable releases

4.5.0 Mar 29, 2026
4.4.0 Mar 29, 2026
4.0.3 Feb 22, 2026
3.5.0 Feb 19, 2026
0.1.8 Jan 22, 2026

#1825 in Network programming

Download history 5/week @ 2026-01-21 1/week @ 2026-01-28 31/week @ 2026-02-18 13/week @ 2026-02-25 22/week @ 2026-03-04 7/week @ 2026-03-11 15/week @ 2026-03-18 36/week @ 2026-03-25 43/week @ 2026-04-08 44/week @ 2026-04-15 35/week @ 2026-04-22 35/week @ 2026-04-29

157 downloads per month
Used in 20 crates (18 directly)

MIT/Apache

185KB
4.5K SLoC

clasp-core

Core types and encoding for the CLASP (Creative Low-Latency Application Streaming Protocol).

Features

  • Message Types: Set, Publish, Subscribe, Bundle, Snapshot, etc.
  • Value Types: Int, Float, Bool, String, Bytes, Array, Map, Null
  • Binary Encoding (v3): 55% smaller, 4x faster than JSON/MessagePack
  • Address Patterns: Hierarchical addressing with wildcards (*, **)
  • Signal Types: Param, Event, Stream, Gesture, Timeline

Usage

use clasp_core::{Message, SetMessage, Value, codec};

// Create a set message
let msg = Message::Set(SetMessage {
    address: "/lights/front/brightness".to_string(),
    value: Value::Float(0.75),
    revision: None,
    lock: false,
    unlock: false,
    ttl: Some(Ttl::Sliding(60)), // optional per-message TTL (60s sliding)
});

// Encode to v3 binary format
let encoded = codec::encode(&msg).unwrap();

// Decode (auto-detects v2/v3)
let (decoded, _frame) = codec::decode(&encoded).unwrap();

Binary Encoding

CLASP binary encoding is 55% smaller and 4-7x faster than JSON/MessagePack:

Metric JSON CLASP Binary
SET size ~80 bytes 31 bytes
Encode ~2M msg/s 8M msg/s
Decode ~2M msg/s 11M msg/s

Address Patterns

CLASP uses hierarchical addresses with wildcard support:

Pattern Matches
/lights/front Exact match
/lights/* Single segment wildcard
/lights/** Multi-segment wildcard
/lights/zone5* Embedded wildcard

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.


Maintained by LumenCanvas

Dependencies

~1.5–2.5MB
~47K SLoC