Skip to content

refactor: split typed_api.rs, typed_record.rs, and client.rs - #500

Merged
lxsaah merged 1 commit into
mainfrom
refactor/460-split-typed-api
Nov 24, 2026
Merged

lxsaah merged 1 commit into
mainfrom
refactor/460-split-typed-api

Conversation

@solus161

Copy link
Copy Markdown
Collaborator

Description

This PR is purely refactor aimdb--core typed_api.rs, typed_record.rs and session/client.rs by splitting these into equivalent modules/test. Detailed summary is in commit message.

Related Issue

Checklist

  • I have read the CONTRIBUTING.md document.
  • My code follows the project's coding standards.
  • I have added tests to cover my changes.
  • All new and existing tests passed (make check).
  • I have updated the documentation accordingly.

refactor(core): split typed_api, typed_record and session client tests
(#460)

Pure reorganisation, no behaviour change; public paths are unchanged.
- typed_api.rs -> typed_api/{producer,consumer,registrar,link_outbound,
link_inbound}.rs; Input/Output and the Detached markers stay in mod.rs,
everything is re-exported from there. Inline tests split per concern
into typed_api/tests/{registrar,link_inbound,link_outbound,build}.rs
with shared fixtures in tests/mod.rs (55 tests, unchanged).
- typed_record.rs -> typed_record/{record,any_record,json_adapters}.rs;
JsonReaderAdapter moves next to JsonRecordAccess, which is now gated
once at module level.
- Remove the four #[allow(unused_mut)] in TypedRecord: the feature-gated
mutations move into helpers with a real and a no-op variant
(with_transform_profiling, set_consumers_profiling,
set_source_profiling, missing_remote_buffer_error), so call sites need
no #[cfg]. Also drops the cfg_attr(allow(unused_variables)) on the
consumer loop.
- session/client.rs: inline tests move to session/client/tests.rs,
following session/events.
- Regenerate four aimdb-data-contracts trybuild snapshots: only source
paths and impl listing order changed.
@solus161
solus161 requested a review from lxsaah as a code owner November 24, 2026 15:40

@lxsaah lxsaah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks a lot!

@lxsaah
lxsaah merged commit af8e0a1 into main Nov 24, 2026
10 checks passed
@lxsaah
lxsaah deleted the refactor/460-split-typed-api branch November 24, 2026 19:48
lxsaah pushed a commit that referenced this pull request Nov 24, 2026
Restore the line break between the two bullets in the Input docs, so
rustdoc renders them as separate list items, and drop the empty test
module left in typed_api/link_inbound.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJAA2rC3Yn2KLShtuvP
lxsaah pushed a commit that referenced this pull request Nov 24, 2026
- Rename TypedRecord::set_consumers_profiling to set_consumer_profiling;
  it attaches profiling to a single consumer.
- Move typed_record's inline tests into typed_record/tests.rs, as
  typed_api/tests/ and session/client/tests.rs already do.
- Replace the #[allow(unused_mut)] in the outbound-link consumer factory
  with a link_consumer helper that has an observability variant and a
  no-op variant.
- Narrow ConsumerServiceFn / ProducerServiceFn from pub(super) to
  pub(in crate::typed_record).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJAA2rC3Yn2KLShtuvP
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.

2 participants