feat: codegen for the Reply-based Dispatch + Call addressing - #8
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Catches
comline-codegen-rustup to runtime#10 (pluggable framing).<Proto>Dispatchergainsfn calls(&self) -> &'static [&'static str](returns<PROTO>_CALLS) — lets a name-oriented framing resolve a method to an ordinal.dispatchtakesreply: &mut Replyinstead ofout: &mut dyn BufMut; arms callreply.ok(&body)/reply.err(ord, &body)instead ofEnvelope::encode_*. The handler-return binding is renamedvalue(wasreply— would shadow the param). A fully one-way protocol names the param_reply.Call::new(i, "name")(both addresses — the framing picks) tocall/call_with_timeout/notify.BufMut→Call, Reply.Behaviour is unchanged (datagram framing); a framing selector on the generated
connect/servehelpers is a follow-up.Tests
tests/compiles.rsbuilds the generatedlibcrate against the newcomline-runtime;tests/generate.rsstring assertions updated (8 pass). Clippy clean.Follow-up
Conformance corpus re-bless (
protocolgolden changes).