Skip to content

[codex] Add zero-copy frame bytes#1921

Draft
kixelated wants to merge 1 commit into
devfrom
codex/zero-copy-frames
Draft

[codex] Add zero-copy frame bytes#1921
kixelated wants to merge 1 commit into
devfrom
codex/zero-copy-frames

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

  • Add moq_net::AsBytes so owned Bytes, BytesMut, Vec, and String inputs can keep their allocation while borrowed byte inputs copy explicitly.
  • Store whole-frame Bytes directly in FrameProducer, while partial writes and BufMut receive paths still use a mutable frame buffer.
  • Thread owned Bytes through moq-mux whole-frame importers and selected web-transport write paths.
  • Apply formatter output required by just check and fix two broken moq-native rustdoc links.

Public API changes

  • Adds public moq_net::AsBytes.
  • Changes FrameProducer::write, GroupProducer::{write_frame, write_frame_now}, and TrackProducer::{write_frame, write_frame_now} from Into to AsBytes.
  • Changes moq-mux whole-frame importer decode methods for AAC, Opus, VP8, VP9, legacy, and import::Track from &[u8] to AsBytes.

Breaking change note

This can be source-breaking for custom caller buffer types that implemented Into but do not implement AsBytes. Common inputs remain covered: Bytes, BytesMut, Vec, String, &str, &[u8], &[u8; N], and borrowed owned buffers.

Validation

  • just check

(Written by Codex)

@kixelated kixelated force-pushed the codex/zero-copy-frames branch 2 times, most recently from ecea7ff to 150a8cf Compare June 26, 2026 19:05
@kixelated kixelated force-pushed the codex/zero-copy-frames branch from 150a8cf to c4d6ea3 Compare June 26, 2026 19:20
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