quill-pubsub 0.1.0

Lightweight pub/sub topic-matching engine (MQTT-style wildcards, trie-backed registry)
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented3 out of 3 items with examples
  • Size
  • Source code size: 40.7 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 358.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1s Average build duration of successful builds.
  • all releases: 1s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • rayomqio/quill
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Pyr33x

Quill

Crates.io Docs License Rust Edition Build Tests

A small Rust library for pub/sub topic matching — hierarchical topics, MQTT-style wildcards (+ / #), and a concurrent trie-backed registry.

No networking, wire protocols, persistence, or delivery queues. Quill is the matching core you embed in a broker or event system.

Install

cargo add quill-pubsub

Usage

use quill::{Pattern, Registry, Topic};

let registry = Registry::new();
registry.subscribe(Pattern::parse("sensors/+/temp").unwrap(), "subscriber-a");
registry.subscribe(Pattern::parse("sensors/#").unwrap(), "subscriber-b");

let topic = Topic::parse("sensors/kitchen/temp").unwrap();
let matched = registry.matching(&topic);
// matched contains "subscriber-a" and "subscriber-b" (order unspecified)

registry.fanout(&topic, &42_u32, |subscriber, payload| {
    println!("{subscriber} <- {payload}");
});

API

Type Role
Topic Parsed hierarchical path (sensors/kitchen/temp)
Pattern Subscription filter with + and #
Registry Concurrent subscribe / unsubscribe / match / fan-out

License

Licensed under the Apache License, Version 2.0.