weida

GitHub crates.io

weida

weida is a messaging framework for Rust built from first principles around QUIC. Every user data flow maps to one QUIC stream, so a 40-byte transfer and a 40-GB transfer use the same protocol semantics and neither requires the payload to be materialized in memory.
weida-broker

weida-broker

L2, and a layer rather than a fork: queues at endpoint paths, the publisher confirm and the absolute per-subscription credit; depends on weida and nothing depends on it (0018 §4.1)

On crates.io at 0.1.0-alpha.2. Opens 0018: The minimal L2 broker — a queue at a path, `Accepted` in, `Processed` out.

weida

weida

runtime, the QUIC, in-process, AF_UNIX and named-pipe transports, the raw stream core, all six patterns — Req/Rep, Push/Pull, Pub/Sub, PAIR, SURVEY, BUS — and the cursor back channel

On crates.io at 0.1.0-alpha.2. Opens Architecture.

weida-protocol

weida-protocol

wire codec, no I/O: varints, framing, CBOR headers, negotiation, error codes

On crates.io at 0.1.0-alpha.2. Opens weida wire protocol, version 0.

weida-core

weida-core

I/O-free model: errors, endpoint addresses, limits, trace context

On crates.io at 0.1.0-alpha.2. Opens Architecture.

weida-runtime

weida-runtime

the reactor and the OS plumbing, with no protocol in it: tasks, timers, DNS with a capped resolver, the three reactor-ownership constructors, a bounded close budget, an in-process name registry, AF_UNIX bind hygiene with peer credentials and, on Windows, named-pipe hygiene with the client's SID

On crates.io at 0.1.0-alpha.2. Opens Architecture.

to come

To come on the weida line

Consumer acknowledgement and redelivery.

Named in README.md. Opens the source.

weida-raft

weida-raft

openraft plus the I/O it deliberately does not have — weida's transport under it — so a Raft service needs only a state machine (0021)

On crates.io at 0.1.0-alpha.2. Opens 0021: Consensus is a dependency, not a subsystem — openraft inside `weida-broker`.

weida-py

weida-py

the Python surface of weida itself: every pattern including the streamed fan-out, asyncio and synchronous (docs/libraries/weida-py.md)

Not published. Opens weida for Python (the Rust API of `crates/weida`) — API parity.

weida-openbao

weida-openbao

OpenBao/Vault for weida: token, AppRole and wrapped hand-off authentication, and identity sources signed by a PKI mount, anchored on its CA, or read from KV; its own crate because it carries the HTTP client and JSON the core does not (0032 §4.3, docs/libraries/weida-openbao.md)

On crates.io at 0.1.0-alpha.2. Opens weida-openbao.

weida-zmtp

weida-zmtp

ZMTP 3.1 — greeting, framing, commands, metadata — with no I/O and no dependency on weida at all

On crates.io at 0.1.0-alpha.2. Opens ZeroMQ (libzmq 4.3.5) — feature parity.

weida-zmq

weida-zmq

the ZeroMQ implementation: every socket type of zmq_socket(3) bar ZMQ_STREAM, tcp/ipc/inproc, NULL/PLAIN/CURVE with ZAP, the option table, the monitor and the devices, interop-tested against libzmq 4.3.5 in both roles (docs/libraries/zmq.md)

Not published. Opens ZeroMQ (libzmq 4.3.5) — feature parity.

weida-zmq-py

weida-zmq-py

the Python ZeroMQ surface: all eleven socket types, the three transports, the option table, PLAIN/CURVE/ZAP with a handler in Python, and a synchronous surface beside the asyncio one (docs/libraries/zmq-py.md)

Not published. Opens ZeroMQ for Python (pyzmq 27.2.0 over libzmq 4.3.5) — feature parity.

weida-sp

weida-sp

nanomsg/NNG Scalability Protocols — the eight-octet header, the 64-bit framing, the REQ/REP tag stacks — with no I/O and no dependency on weida

Not published. Opens nanomsg/NNG (SP v1, measured against NNG 1.4.0-rc.0) — feature parity.

weida-nng

weida-nng

the SP implementation: one socket type per protocol, endpoints and pipes, the option table, TLS and IPC credentials, interop-tested against NNG 1.4.0-rc.0 in both roles (docs/libraries/nng.md)

Not published. Opens nanomsg/NNG (SP v1, measured against NNG 1.4.0-rc.0) — feature parity.

weida-nng-py

weida-nng-py

the Python SP surface: one class per protocol, contexts as objects, asyncio and synchronous

Not published. Opens NNG for Python (pynng 0.9.0 over NNG 1.11.0) — feature parity.

weida-mqtt-codec

weida-mqtt-codec

MQTT 5.0 — the fixed header, Variable Byte Integers, the property framework and every control packet — sans-I/O

Not published. Opens MQTT 5.0 (OASIS Standard 2019-03-07, measured against rumqttd 0.20.0 and rmqtt 0.23.1) — feature parity.

weida-mqtt

weida-mqtt

the MQTT 5.0 client: connection, session, both QoS machines, subscriptions, retain and Will, aliases, TLS and AUTH, interop-tested against rumqttd 0.20.0 and rmqtt 0.23.1 (docs/libraries/mqtt.md)

Not published. Opens MQTT 5.0 (OASIS Standard 2019-03-07, measured against rumqttd 0.20.0 and rmqtt 0.23.1) — feature parity.

to come

To come on the MQTT 5 line

The server half (Phase D).

Named in docs/status/product-line.svg. Opens the source.

weida-mqtt-py

weida-mqtt-py

the Python MQTT surface: publish, subscribe and an iterator of deliveries, 51 exception classes, asyncio and synchronous

Not published. Opens MQTT 5 for Python (paho-mqtt 2.x) — feature parity.

weida-amqp-codec

weida-amqp-codec

AMQP 1.0 — the Part 1 type system, frames, performatives and message sections — sans-I/O

Not published. Opens AMQP 1.0 (OASIS Standard, 29 October 2012) — feature parity.

weida-amqp

weida-amqp

the AMQP 1.0 client: connection, session and link with both credit schemes, the settle modes, dispositions and SASL, interop-tested against fe2o3-amqp 0.17.0 in both roles (docs/libraries/amqp.md)

Not published. Opens AMQP 1.0 (OASIS Standard, 29 October 2012) — feature parity.

to come

To come on the AMQP 1.0 line

The server half (Phase D).

Named in docs/status/product-line.svg. Opens the source.

weida-amqp-py

weida-amqp-py

the Python AMQP surface: connection, session and link as objects, send returning the delivery's terminal state, asyncio and synchronous

Not published. Opens AMQP 1.0 for Python (python-qpid-proton 0.40.0) - feature parity.

weida-nats-codec

weida-nats-codec

the NATS client protocol — twelve control-line verbs and the NATS/1.0 header block — sans-I/O

Not published. Opens Core NATS (client protocol, `nats-server` 2.14) — feature parity.

weida-nats

weida-nats

the Core NATS client: subjects and wildcards, queue groups, request-reply over an inbox, five credential forms and TLS; interop is written and not run, because no nats-server was available (docs/libraries/nats.md)

Not published. Opens Core NATS (client protocol, `nats-server` 2.14) — feature parity.

weida-nats-py

weida-nats-py

the Python NATS surface: publish with headers, subscriptions as iterators, queue groups, request with a mandatory timeout, asyncio and synchronous

Not published. Opens Core NATS for Python (nats-py 2.15.0) - feature parity.

weida-py-core

weida-py-core

the shared PyO3 foundation under every binding, with nothing protocol-specific in it: errno exception families, the asyncio bridge that drives a Rust future on the caller's loop, and the bytes boundary (0014 §2)

Not published. Opens 0014: Four parallel library workstreams, and bindings that follow each library.

weida-winpipe

weida-winpipe

the Win32 calls a named pipe needs and nothing else — an owner-only DACL, the client's token SID, the pipe's owner SID, both process ids — behind a safe surface; the one crate that may use unsafe, and empty off Windows

On crates.io at 0.1.0-alpha.2. Opens 0010: The local transport, per platform.

weida-broker weida weida-protocol weida-core weida-runtime to come weida-raft weida-py weida-openbao weida-zmtp weida-zmq weida-zmq-py weida-sp weida-nng weida-nng-py weida-mqtt-codec weida-mqtt to come weida-mqtt-py weida-amqp-codec weida-amqp to come weida-amqp-py weida-nats-codec weida-nats weida-nats-py weida-py-core weida-winpipe

Lines and stations read off cargo metadata at 5a20f15; every segment is a dependency between two workspace crates. Publication state from crates.io. Pending segments from README.md and docs/status/product-line.svg.

What it is

L0L1L2

It is built in layers. L0 is a stream core: ZeroMQ's idea rebuilt on QUIC, whose primitives are unidirectional and bidirectional streams with exactly the guarantees QUIC gives — ordered bytes within a stream, none across streams, flow control, a transport delivery receipt, and cancellation by reset. L1 is the ZeroMQ/nanomsg pattern family as thin wrappers over L0: Req/Rep, Push/Pull, Pub/Sub, PAIR, SURVEY and BUS — the whole nanomsg set, and none of them adds wire vocabulary. L2 is a RabbitMQ-analog broker, weida-broker: queues at endpoint paths, publisher confirms, and an absolute per-subscription credit. Consumer acknowledgement and redelivery are the slice still to come.

The cursor

A completion is a cursor, not a verdict: a level plus an absolute byte offset, reported on a unidirectional stream of its own that never shares a stream with payload. So a Push producer gets a reliable Accepted without an exchange, a reader learns how far the far end got rather than only whether it finished, and no pattern changes shape to gain any of it.

State

Status: alpha. Published on crates.io: weida, weida-core, weida-protocol, weida-runtime and weida-winpipe at 0.1.0-alpha.1 and 0.1.0-alpha.2, and weida-broker, weida-raft and weida-openbao at 0.1.0-alpha.2. The other seventeen members are not published: weida-py-core, every Python binding and all five protocol libraries with their codecs. Nothing is on PyPI and there are no prebuilt binaries. Wire protocol version 0 is experimental and breaking changes are permitted within 0.x. Phases 0-3 are implemented — the docs, the core model, the native QUIC transport, the in-process, AF_UNIX and named-pipe transports, all six patterns, the raw L0 stream API, peer identity by public-key fingerprint, opt-in per-producer ordering and bounded deduplication, a bounded drain, the cursor back channel, a synchronous facade (weida::blocking), a weida binary and a Python binding (weida-py) — and the first two broker slices with them. Beside weida the repository ships five protocol libraries, none of which has weida in its picture: ZeroMQ (weida-zmtp + weida-zmq + weida-zmq-py), the nanomsg SP protocols (weida-sp + weida-nng + weida-nng-py), MQTT 5 (weida-mqtt-codec + weida-mqtt + weida-mqtt-py), AMQP 1.0 (weida-amqp-codec + weida-amqp + weida-amqp-py) and Core NATS (weida-nats-codec + weida-nats + weida-nats-py), each with a parity document under docs/libraries/ and each measured against a real peer where one exists. weida-zmq is complete against decisions/0013 §4.7's definition of first-class — every socket type of zmq_socket(3) bar ZMQ_STREAM, tcp/ipc/inproc, NULL/PLAIN/CURVE with ZAP, the option table honoured or refused row by row, the monitor and the devices, the zguide's canonical recipes as examples that assert the guide's own claims, and interop against libzmq 4.3.5 and the pure-Rust zeromq crate in both roles (docs/libraries/zmq.md). Its typed proxy and proxy_steerable devices include the canonical ROUTER/DEALER queue, XSUB/XPUB forwarder and PULL/PUSH streamer without involving the weida protocol.

From README.md.

Quick start, without writing a program

$ cargo run -q -p weida --bin weida -- serve --echo 'weida://127.0.0.1:7443/echo'
weida://sha256:22ed30a8…9f25@127.0.0.1:7443/echo
$ printf 'hello weida' | cargo run -q -p weida --bin weida -- request 'weida://sha256:22ed30a8…9f25@127.0.0.1:7443/echo'
hello weida

In a program with no reactor, the same shape is a library call: weida::blocking behind the non-default blocking feature wraps every endpoint, one block_on each, over a reactor it owns — and refuses to be called from inside a Tokio runtime, where blocking a worker would deadlock.

Four verbs: serve (with --echo, --sink or --pub), request, send and sub. The payload is on stdin and stdout and nothing else is, so weida request … | sha256sum means what it looks like; addresses, receipts and topics go to stderr. The address serve printed is the whole client configuration, exactly as in the section below. Every transport works the same way — weida+unix://%2Ftmp%2Fs.sock/echo for a socket, weida+pipe://NAME/echo for a Windows pipe — and the exit code names the error a script can act on: 3 refused, 4 unknown endpoint, 5 no reply, 6 untrusted, 7 connection lost. weida --help lists every option, including sub --framing line|raw|nul|length, because a newline after each payload is readable and is not framing.

Identity in one line

A weida peer is its public key. The server generates an identity and prints an address that names it; the client trusts that address and nothing else:

$ cargo run -p weida --example transform_server -- --bind 127.0.0.1:7443
weida://sha256:22ed30a8…9f25@127.0.0.1:7443/transform
weida://sha256:22ed30a8…9f25@127.0.0.1:7443/echo
$ printf 'hello weida' | cargo run -p weida --example transform_client -- 'weida://sha256:22ed30a8…9f25@127.0.0.1:7443/transform'
HELLO WEIDA

No certificate file changes hands, no CA exists, and a peer with any other key is refused with Untrusted(sha256:…) naming the key that answered. --identity PATH keeps the server's key across restarts so the address stays stable; --cert-out PATH plus transform_client --ca PATH is the same exchange through a trusted certificate and a plain address instead. In code: Identity::generate(), Trust::by_address() / Trust::pin(fp) / Trust::anchor(pem), ServerTls::require_client(trust) for mutual identity, and IncomingMeta::peer to see who sent what.

Expected on stderr: delivered — QUIC's transport receipt for the request, not an application acknowledgement — and a trace id that also appears in the server's log line for the request.

Lines

LineStationsDocument
weidaweida
  • weida-broker0.1.0-alpha.2
  • weida0.1.0-alpha.2
  • weida-protocol0.1.0-alpha.2
  • weida-raft0.1.0-alpha.2
  • weida-pynot published
  • weida-openbao0.1.0-alpha.2
Architecture
ZMQZeroMQ
  • weida-zmtp0.1.0-alpha.2
  • weida-zmqnot published
  • weida-zmq-pynot published
ZeroMQ (libzmq 4.3.5) — feature parity
NNGnanomsg
  • weida-spnot published
  • weida-nngnot published
  • weida-nng-pynot published
nanomsg/NNG (SP v1, measured against NNG 1.4.0-rc.0) — feature parity
MQTTMQTT 5
  • weida-mqtt-codecnot published
  • weida-mqttnot published
  • weida-mqtt-pynot published
MQTT 5.0 (OASIS Standard 2019-03-07, measured against rumqttd 0.20.0 and rmqtt 0.23.1) — feature parity
AMQPAMQP 1.0
  • weida-amqp-codecnot published
  • weida-amqpnot published
  • weida-amqp-pynot published
AMQP 1.0 (OASIS Standard, 29 October 2012) — feature parity
NATSCore NATS
  • weida-nats-codecnot published
  • weida-natsnot published
  • weida-nats-pynot published
Core NATS (client protocol, `nats-server` 2.14) — feature parity
baseShared foundation
  • weida-core0.1.0-alpha.2
  • weida-runtime0.1.0-alpha.2
  • weida-winpipe0.1.0-alpha.2
  • weida-py-corenot published
0014: Four parallel library workstreams, and bindings that follow each library

Destinations