Skip to content

feat(rust): honour GenRequest.default_framing as the per-package fallback - #10

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

feat(rust): honour GenRequest.default_framing as the per-package fallback#10
Kinflou merged 1 commit into
mainfrom
feat/default-framing

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 2, 2026

Copy link
Copy Markdown
Member

PR 2 of the default_framing chain (after generation#17).

A protocol's framing now resolves most-specific-first:

  1. its own @framing annotation
  2. the package default_framingcomline.toml's [generate] default_framing, carried on GenRequest
  3. the datagram default

New: @framing = "datagram" (comline.datagram) is a recognised value, so one protocol can opt back to datagram when the package default is jsonrpc. An unrecognised name at either level falls through to the next.

Output is byte-identical to before whenever default_framing is None and nothing names datagram explicitly — conformance goldens unaffected.

  • Bumps the comline-codegen pin to generation c70336d.
  • generate.rs: package default reaches an unannotated protocol; @framing = "datagram" beats a jsonrpc package default.
  • compiles.rs: one generated crate now builds all three resolution paths — chat opts out to datagram, clock takes the default, rpc names jsonrpc itself.

…back

A protocol's framing now resolves most-specific-first:

  1. its own `@framing` annotation
  2. the package `default_framing` (comline.toml, via GenRequest)
  3. the datagram default

`@framing = "datagram"` (or `"comline.datagram"`) is now recognised too, so
a single protocol can opt back to datagram when the package default is
`jsonrpc`. An unrecognised name at either level falls through to the next.

Output is unchanged whenever `default_framing` is None and no protocol names
`datagram` explicitly — the conformance goldens don't move.

Bumps the comline-codegen pin to generation c70336d (the rev that adds
GenRequest.default_framing).

tests:
  - generate.rs: package default applies to an unannotated protocol;
    `@framing = "datagram"` beats a `jsonrpc` package default
  - compiles.rs: one crate now builds all three resolutions at once —
    `chat` opts out to datagram, `clock` takes the default, `rpc` names it
@Kinflou
Kinflou merged commit 85fd967 into main Sep 2, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/default-framing branch September 2, 2026 07:42
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