Skip to content

Conversation

@leshow
Copy link
Collaborator

@leshow leshow commented Sep 8, 2025

#88 talked about no_std and a zero alloc parser for dhcp options. This does some initial work towards that. I put it in a new module borrowed under v4. It doesn't try to do everything that the owned version of Message does but it might be sufficient for most use cases. Internally it uses a Cow for options. The vast majority of options will not allocate, but in the case of a long-form option where the optcode and data have to be concatenated, it will return the Borrowed variant and allocate.

Still need some tests and a few more methods but I think this could be interesting for a zero-copy message type

@coveralls
Copy link
Collaborator

coveralls commented Sep 8, 2025

Pull Request Test Coverage Report for Build 18151245175

Details

  • 232 of 258 (89.92%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.6%) to 51.277%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/v4/mod.rs 12 13 92.31%
src/v4/borrowed.rs 216 241 89.63%
Totals Coverage Status
Change from base Build 17251797289: 3.6%
Covered Lines: 1867
Relevant Lines: 3641

💛 - Coveralls

@leshow leshow changed the title WIP: add zero copy Message Add zero copy Message Oct 1, 2025
@leshow leshow merged commit 61cc6ba into master Oct 1, 2025
20 checks passed
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.

3 participants