Skip to content

feat(dynamic_message): add DynamicSequence length helpers#591

Open
bresilla wants to merge 1 commit intoros2-rust:mainfrom
bresilla:dynamic_sequence
Open

feat(dynamic_message): add DynamicSequence length helpers#591
bresilla wants to merge 1 commit intoros2-rust:mainfrom
bresilla:dynamic_sequence

Conversation

@bresilla
Copy link

What

Adds small ergonomic helpers to dynamic message sequences:

  • len() / is_empty() for DynamicSequence, DynamicBoundedSequence, DynamicSequenceMut, DynamicBoundedSequenceMut
  • iter() for immutable sequences

Why

Makes it easier to traverse dynamic message sequences (especially sequences of nested messages) without reaching into internal storage.

Notes

  • No behavior change; purely additive API.
  • cargo test passes.

Copilot AI review requested due to automatic review settings January 24, 2026 20:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds ergonomic helper methods to dynamic message sequence types to improve ease of use when working with nested messages.

Changes:

  • Added len() and is_empty() methods to all four sequence types for querying sequence length
  • Added iter() method to immutable sequence types (DynamicSequence and DynamicBoundedSequence)
  • Reformatted imports to use nested import syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@luca-della-vedova luca-della-vedova left a comment

Choose a reason for hiding this comment

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

I believe but please correct me if I'm wrong that since all the types implement Deref which just returns the inner slice, we can just deref the sequences through * then we should be able to use all of Rust's slice APIs (i.e. is_empty) so we wouldn't need to implement any ourselves

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