Repository navigation
feat: reg.input / reg.output, connector handles and publish / subscribe (#388) - #392
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGkDJ9WeZVdrZq1pBgvAxK
This was referenced Nov 2, 2026
This was referenced Nov 2, 2026
Closed
lxsaah
marked this pull request as ready for review
November 2, 2026 20:12
This was referenced Nov 2, 2026
Closed
2 of 5 tasks
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.
Description
Implements #388: wiring a record to its inputs and outputs so that a wrong wiring is a compile error where possible, and a
build()error otherwise. Each sub-issue was merged into this branch through its own PRs.#389: detachable links,
Input/Output(#393–#396)OutboundLinkBuilder<T, R>/InboundLinkBuilder<T, R>.OutboundConnectorBuilder/InboundConnectorBuilderremain as aliases, solink_to(..)…finish()and existing extension impls compile unchanged.OutboundLink<T>/InboundLink<T>is built withnew(url).Input<T>/Output<T>with#[diagnostic::on_unimplemented], plusreg.input(..)/reg.output(..).LinkCodecBuilderExtextension traits apply to both forms.#390:
connectandConnectorHandle(#397–#399)AimDbBuilder::connect(c) -> ConnectorHandle: aCopyhandle holding the builder's id and the connector's index. It stores no scheme string.OutboundLink::on(handle, address)/InboundLink::on(..):#[link_address]keys) must match it.build().#391:
publish/subscribe, demos, conventions (#400–#404)publish(handle, address)/subscribe(..)forLinkablecontracts: plain links in the contract's codec that report its schema, through the newwith_schemalink option. Every connector option applies.linked_to/linked_from/*_withshare their implementation, with unchanged behaviour.mqtt-connector-demo-commonis the shared, runtime-agnostic crate:Linkable, with the hand-rolled no_std JSON removedSimThermometers/Thermometer: owned channels, one input for everyT: From<Reading>Both MQTT demos use
connect+publish/subscribe. The embassy demo gainsboard.rs, and B1 becomes aPushButtoninput publishingButtonPress.The usage guide documents the conventions:
From<Event>Fromimpls livebuild()Input's rustdoc has acompile_fail,E0382doctest. The guide's Tokio examples were fixed to compile, and its crate versions updated.Compatibility
No source changes are required. Two behaviour changes:
#[must_use]on the link builders. Alink_to(..)/link_from(..)whose.finish()is missing now warns, which is an error under-D warnings. Before, such a link was silently dropped. No code in this repository had one.build()error names kinds (source + inbound link) instead of methods (.source()).Embassy MQTT demo firmware, release
thumbv8m.main-none-eabihf:.text.rodataThe shared input brings
.textto 539,948 without the button; the new B1 record adds the rest.Tested against a broker
Both MQTT demos were run against the
dev/mosquittobench broker (authenticated, plain 1883) on the developer host:tokio-mqtt-connector-demo: all 15 readings published onsensors/temp/{indoor,outdoor,server_room}, with the expected JSON. Commands oncommands/temp/indoor/outdoorwere received by the demo.embassy-mqtt-connector-demo, flashed on a Nucleo-H563ZI with probe-rs:sensors/button/b1({"button":"b1","press":1..7}), each exactly once and in order.The
tlsbuild was compiled and linted, but not run against the TLS listener.Related Issue
Checklist
make check): CI on this PR.🤖 Generated with Claude Code