Skip to content

feat: codegen for the Reply-based Dispatch + Call addressing - #8

Merged
Kinflou merged 1 commit into
mainfrom
feat/framing-codegen
Sep 1, 2026
Merged

feat: codegen for the Reply-based Dispatch + Call addressing#8
Kinflou merged 1 commit into
mainfrom
feat/framing-codegen

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 1, 2026

Copy link
Copy Markdown
Member

Catches comline-codegen-rust up to runtime#10 (pluggable framing).

  • <Proto>Dispatcher gains fn calls(&self) -> &'static [&'static str] (returns <PROTO>_CALLS) — lets a name-oriented framing resolve a method to an ordinal.
  • dispatch takes reply: &mut Reply instead of out: &mut dyn BufMut; arms call reply.ok(&body) / reply.err(ord, &body) instead of Envelope::encode_*. The handler-return binding is renamed value (was reply — would shadow the param). A fully one-way protocol names the param _reply.
  • the client stub passes Call::new(i, "name") (both addresses — the framing picks) to call / call_with_timeout / notify.
  • import line: BufMutCall, Reply.

Behaviour is unchanged (datagram framing); a framing selector on the generated connect / serve helpers is a follow-up.

Tests

tests/compiles.rs builds the generated lib crate against the new comline-runtime; tests/generate.rs string assertions updated (8 pass). Clippy clean.

Follow-up

Conformance corpus re-bless (protocol golden changes).

Catches comline-codegen-rust up to runtime#10 (pluggable framing):

- the generated <Proto>Dispatcher gains `fn calls(&self) -> &'static
  [&'static str]` (returns <PROTO>_CALLS) so a name-oriented framing can
  resolve a method to an ordinal.
- `dispatch` takes `reply: &mut Reply` instead of `out: &mut dyn BufMut`;
  arms call `reply.ok(&body)` / `reply.err(ord, &body)` instead of
  `Envelope::encode_*`. The handler-return binding is `value` now (was
  `reply`, which would shadow the param). A fully one-way protocol names
  the param `_reply`.
- the client stub passes `Call::new(i, "name")` (both addresses) to
  `call` / `call_with_timeout` / `notify`, not a bare `i u16`.
- import line: `BufMut` -> `Call, Reply`.

Bumps the generated crate's comline-runtime pin. tests/compiles.rs builds
the generated crate against the new runtime; generate.rs string
assertions updated. Behaviour is still datagram framing — a framing
*selector* on the generated connect/serve helpers is a follow-up.

The conformance corpus golden re-bless follows separately.
@Kinflou
Kinflou merged commit ca7e915 into main Sep 1, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/framing-codegen branch September 1, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant