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, and a flow whose units are worthless once late maps to QUIC datagrams, 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, the absolute per-subscription credit and consumer settlement with requeue; depends only on weida, and nothing depends on it (0018 §4.1)

On crates.io at 0.1.0-alpha.16. 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, every pattern — Req/Rep, Push/Pull, Pub/Sub, PAIR, SURVEY, BUS, RADIO/DISH and, behind the feature swarm, SWARM — and the cursor back channel

On crates.io at 0.1.0-alpha.16. 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.16. 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.16. 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.16. Opens Architecture.

to come

To come on the weida line

Redelivery count, report relay and queue retirement.

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 supplies only its state machine and log store (0021)

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

weida-c

weida-c

the C ABI every other language binds, libweida and weida.h: typed handles, status codes, readiness descriptors and weida_poll; so far the runtime, TLS values and streamed Req/Rep (docs/c/, 0045, docs/libraries/weida-c.md)

Not published. Opens weida's C ABI (`libweida`, against the Rust API of `crates/weida`) — feature 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.16. 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.

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.18.4 in both roles (docs/libraries/amqp.md)

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

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; its interop tests are written and not run, because they need a nats-server (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.16. Opens 0010 — The local transport, per platform.

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

Lines and stations read off cargo metadata at 92c768a; every segment is a dependency between two workspace crates. Publication state from crates.io. Pending segments from README.md.

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 and datagram flows 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 RADIO/DISH for lossy fan-out of segments; only RADIO/DISH adds wire vocabulary (DATA key 13, SUBSCRIBE key 2). L2 is a RabbitMQ-analog broker, weida-broker: queues at endpoint paths, publisher confirms, an absolute per-subscription credit, and consumer settlement with requeue when a consumer is lost. The redelivery count on the wire, relaying a consumer's report to the producer and retiring a queue are 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. weida, weida-core, weida-protocol, weida-runtime, weida-winpipe, weida-broker, weida-raft, weida-openbao, weida-http-codec and weida-http are published on crates.io, all at 0.1.0-alpha.16. The other eighteen members are not published: weida-c, weida-py-core, every Python binding, the other five protocol libraries with their codecs, and weida-testkit, which only tests use. The one exception on crates.io, weida-zmtp 0.1.0-alpha.2, is an old release that receives no updates. The Python package weida goes to pypi.org with every v* tag from 0.1.0-alpha.16 on, as wheels for manylinux x86_64 and aarch64, macOS 11 arm64 and win_amd64 and with no sdist. The JavaScript package weida goes to npmjs.org with every v* tag from 0.1.0-alpha.14 on, with prebuilt libweida for linux-x64, linux-arm64, darwin-arm64 and win32-x64; up to 0.1.0-alpha.13 it was @tuco86/weida on the forge's npm registry. Wire protocol version 0 is experimental and breaking changes are permitted within 0.x. Phase status lives in docs/IMPLEMENTATION.md §1.

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

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 or ServerTls::require_client(ClientTrust::AnyKey) for clients whose key is their only 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.16
  • weida0.1.0-alpha.16
  • weida-protocol0.1.0-alpha.16
  • weida-raft0.1.0-alpha.16
  • weida-cnot published
  • weida-openbao0.1.0-alpha.16
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.16
  • weida-runtime0.1.0-alpha.16
  • weida-winpipe0.1.0-alpha.16
  • weida-py-corenot published
0014 — Four parallel library workstreams, and bindings that follow each library

Destinations