Skip to content

feat(rust): add wire types for all commands and zero-copy message primitives#2962

Open
hubcio wants to merge 1 commit intomasterfrom
refactor-binary-3-all-commands
Open

feat(rust): add wire types for all commands and zero-copy message primitives#2962
hubcio wants to merge 1 commit intomasterfrom
refactor-binary-3-all-commands

Conversation

@hubcio
Copy link
Contributor

@hubcio hubcio commented Mar 17, 2026

The binary_protocol crate had wire types for streams only. This
adds the remaining 41 commands plus shared primitives and
zero-copy message frame types. This code is not yet used.

…mitives

The binary_protocol crate had wire types for streams only. This
adds the remaining 41 commands plus shared primitives and
zero-copy message frame types.

Shared primitives: WireConsumer, WirePartitioning,
WirePollingStrategy, WirePermissions (full hierarchy).

Requests: all 10 categories (consumer_groups, consumer_offsets,
messages, partitions, personal_access_tokens, segments, system,
topics, users) with WireEncode + WireDecode + roundtrip tests.

Responses: all 9 categories (clients, consumer_groups,
consumer_offsets, messages, personal_access_tokens, system,
topics, users) including StatsResponse with CacheMetricsEntry.

Zero-copy message primitives: SendMessagesHeader (metadata-only
decoder), SendMessagesMetadataEncoder (vectored I/O),
RawMessage::encode_header, WireMessageView/Mut (frame views
with typed setters), WireMessageIterator/Mut (frame iterators),
PollMessagesResponseHeader + PollMessagesResponse (borrowed
response with lazy iteration), 8 field offset constants.
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 98.02570% with 106 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.96%. Comparing base (b87a84f) to head (9ddd948).

Files with missing lines Patch % Lines
.../binary_protocol/src/responses/system/get_stats.rs 86.41% 0 Missing and 33 partials ⚠️
core/binary_protocol/src/message_view.rs 91.53% 29 Missing and 2 partials ⚠️
core/binary_protocol/src/codec.rs 32.35% 23 Missing ⚠️
.../binary_protocol/src/requests/users/create_user.rs 96.92% 3 Missing and 1 partial ⚠️
..._protocol/src/requests/users/update_permissions.rs 96.90% 3 Missing ⚠️
...re/binary_protocol/src/responses/users/get_user.rs 97.69% 0 Missing and 3 partials ⚠️
...ore/binary_protocol/src/primitives/partitioning.rs 98.72% 1 Missing and 1 partial ⚠️
.../binary_protocol/src/requests/topics/get_topics.rs 96.42% 0 Missing and 1 partial ⚠️
.../binary_protocol/src/requests/users/delete_user.rs 96.42% 0 Missing and 1 partial ⚠️
...ore/binary_protocol/src/requests/users/get_user.rs 97.14% 0 Missing and 1 partial ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2962      +/-   ##
============================================
+ Coverage     70.36%   71.96%   +1.59%     
  Complexity      925      925              
============================================
  Files          1050     1113      +63     
  Lines         86887    92256    +5369     
  Branches      64444    69823    +5379     
============================================
+ Hits          61141    66388    +5247     
- Misses        23241    23304      +63     
- Partials       2505     2564      +59     
Flag Coverage Δ
csharp 67.43% <ø> (-0.21%) ⬇️
go 36.36% <ø> (ø)
java 61.91% <ø> (ø)
node 91.37% <ø> (-0.04%) ⬇️
python 81.43% <ø> (ø)
rust 72.72% <98.02%> (+2.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/binary_protocol/src/consensus/header.rs 19.93% <ø> (ø)
core/binary_protocol/src/consensus/message.rs 81.81% <ø> (ø)
core/binary_protocol/src/primitives/consumer.rs 100.00% <100.00%> (ø)
core/binary_protocol/src/primitives/identifier.rs 95.96% <ø> (ø)
core/binary_protocol/src/primitives/permissions.rs 100.00% <100.00%> (ø)
...binary_protocol/src/primitives/polling_strategy.rs 100.00% <100.00%> (ø)
.../requests/consumer_groups/create_consumer_group.rs 100.00% <100.00%> (ø)
.../requests/consumer_groups/delete_consumer_group.rs 100.00% <100.00%> (ø)
...src/requests/consumer_groups/get_consumer_group.rs 100.00% <100.00%> (ø)
...rc/requests/consumer_groups/get_consumer_groups.rs 100.00% <100.00%> (ø)
... and 62 more

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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