Skip to content

Support Encode and Decode for core::ops::Bound - #123

Open
jadenfix wants to merge 1 commit into
SoftbearStudios:mainfrom
jadenfix:feat/encode-decode-bound
Open

jadenfix wants to merge 1 commit into
SoftbearStudios:mainfrom
jadenfix:feat/encode-decode-bound

Conversation

@jadenfix

Copy link
Copy Markdown

Add Encode and Decode implementations for core::ops::Bound<T> to support transmitting range bounds, as requested in #122.

The three variants use the existing validated variant and payload codecs, following the Result implementation. No new unsafe code or Clone/Default requirement on T is introduced. The representation matches a derived enum with Included(T), Excluded(T), and Unbounded; no_std and borrowed payload decoding work.

Tests cover all variants, empty and 300-element vectors, reusable buffers, borrowed strings, non-Clone payloads, malformed Unicode, truncated/trailing input, and the derived-enum wire oracle. The public consumer failed to compile on main and now passes 25 range-request serialize/decode/query journeys with default features disabled.

Validation:

  • Default: 214 tests and 6 doctests pass (1 ignored).
  • All features: 242 tests and 6 doctests pass (1 ignored).
  • Documented no-std feature configuration: 232 tests and 6 doctests pass.
  • Full all-feature Miri: 241 tests and 6 doctests pass (1 ignored), using current nightly with strict provenance. The five new tests also pass under 32-bit i686 and big-endian PowerPC64 Miri.
  • Exact MSRV 1.88 default/minimal library checks, formatting, and strict documentation build pass.

The pinned upstream nightly, native Linux cross-target matrix, and upstream CI fuzz command were not executed locally. Optional current-nightly Clippy completes with existing diagnostics outside the new module. A separate AI reviewer checked the final commit and independently reran the five new tests. Prepared with AI assistance.

Closes #122.

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.

req: Encode/Decode for std::ops::Bound<T>

1 participant