Skip to content

feat(core): OutboundLink::on / InboundLink::on take a ConnectorHandle (#390, stage 2) - #398

Merged
lxsaah merged 1 commit into
feature/388-input-output-connectionsfrom
feature/390-links-on-handle
Nov 2, 2026
Merged

lxsaah merged 1 commit into
feature/388-input-output-connectionsfrom
feature/390-links-on-handle

Conversation

@lxsaah

@lxsaah lxsaah commented Nov 2, 2026

Copy link
Copy Markdown
Member

Description

Stage 2 of 2 for #390, into the #392 feature branch.

  • OutboundLink::on(handle, address) / InboundLink::on(handle, address) start a detached link on a connector registered with AimDbBuilder::connect.
    • A bare address ("sensors/temp") takes the connector's scheme.
    • A full URL is accepted if its scheme matches the connector's, so #[link_address] keys keep working.
  • A different scheme, or a handle from another builder, becomes a ConfigError reported by build(). An out-of-range index gets the same message, since only another builder's handle can produce one. The check is connector::resolve_link_url, called at the top of push_outbound and inbound_link, next to the existing link checks. The error names the record and the address as written.
  • Both link builders get a connector: Option<ConnectorHandle> field, carried through new, attach and detach. RecordRegistrar gets the builder's id (builder_id).
  • Docs: rustdoc on on, ConnectorHandle and connect. The usage guide's "Links as values" example uses connect + on.

Tests

  • handle_links_take_the_connector_scheme: with connectors [mqtt, knx], index 1 really yields knx:// in both directions, and a matching full URL is accepted.
  • handle_links_reject_wrong_scheme_and_foreign_handles: wrong scheme in both directions, another builder's handle in both directions, and an out-of-range index. Each case gets its exact error and address, and nothing is registered.
  • handle_links_build_and_foreign_handles_fail_it: the target shape from [FEAT] AimDbBuilder::connect returns a ConnectorHandle; links through a handle need no scheme #390 through build(). A handle from the same builder builds and subscribes commands/temp/indoor; another builder's handle gives InvalidConfiguration naming temp.indoor.

Checks

CI doesn't run on PRs into the feature branch, so I ran these locally:

  • aimdb-core tests with std,tracing,observability (310) and with alloc
  • the thumbv8m build
  • all nine of core's clippy lines from the Makefile (-D warnings)
  • cargo doc with -D warnings
  • cargo check -p tokio-mqtt-connector-demo
  • the MQTT link_ext_tests
  • the aimdb-data-contracts lib tests

The changelog for #390 follows in a separate PR, as for #389.

Related Issue

🤖 Generated with Claude Code

…#390)

A link started from a handle takes the connector's scheme: a bare
address ("sensors/temp") becomes "<scheme>://sensors/temp", and a full
URL is accepted if its scheme is the connector's, so #[link_address]
keys keep working. A different scheme, or a handle from another
builder, is a ConfigError reported by build(); the check runs in
push_outbound / inbound_link next to the existing link checks.

RecordRegistrar carries the builder id to resolve handles against the
connector list it already holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lxsaah
lxsaah merged commit 84162e1 into feature/388-input-output-connections Nov 2, 2026
@lxsaah
lxsaah deleted the feature/390-links-on-handle branch November 2, 2026 19:12
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