Skip to content

Add checked subviews for borrowed byte buffers #759

Closed

Description

@LunaStev

Motivation

Bytes and BytesMut support construction and validity checks but no checked subview operation. Packet parsers currently repeat pointer/offset/length validation.

Starting points: std/bytes/types.wave.

Scope

Add offset/count subview helpers for immutable and mutable borrowed views, following existing checked byte API conventions. Do not allocate or transfer ownership.

Difficulty: easy.

Completion criteria

  • Cover empty views/ranges, end-of-buffer ranges, negatives and out-of-bounds requests.
  • Check ranges without overflowing offset+count or forming invalid pointers.
  • Preserve the output on failure and keep the documented null/empty-view policy.
  • Run allocation-free O0/O2 boundary tests.

Activity

  1. added
    enhancement
    good first issue
    needs testing
    on Sep 25, 2026
  2. self-assigned this
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions