hyperium / hyperium/h3

send_data for arbitrary buffer type

Open
#93 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B-rfc C-refactor
Dominant language
Rust
Stars
890
Forks
136
Avg merge
14d 20h
Merged PRs (30d)
2

Description

The buffer type should not be fixed for a connection or stream. It should be a generic parameter of the send_data function, so that each send_data call on the same stream can have a different buffer type.
This is because when h3 is eventually integrated with hyper, hyper will need to send whatever buffer type the response HttpBody has.
The main issue here is tracking the write progress of an asynchronous write operation. With the current API, it is guaranteed that multiple writes can not be running simultaneously, which would result in them being garbled together.

quinn itself uses the following function signature:

    pub fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a> {

The returned Write struct is a future that contains a mutable borrow of the stream.
I don't know if it would be possible to do something similar with the h3::quic traits.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the send_data API and the h3::quic traits, then compare their write behavior with the quinn write signature shown in the issue. Determine how asynchronous write progress and exclusive stream access should be represented when buffer types vary per call. Done means the API supports the required buffer flexibility without allowing concurrent writes to be garbled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.