rust-embedded / rust-embedded/heapless

Would `heapless` accept a PR for a `Deque`/`RingBuffer` that operates on a mutable slice instead of allocating a buffer of a fixed size?

Open
#589 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2k
Forks
253
Avg merge
1d 2h
Merged PRs (30d)
1

Description

I basically need smoltcp's RingBuffer in a dedicated library, because I want to use it in a non-networking context. You currently cannot use it without adding a dependency to smoltcp and its network features.

One idea is to move it from smoltcp to a dedicated crate, and I have sent out an inquiry whether they would accept a PR in that direction.
Another idea is to use a similar data structure from another crate. I have looked at the Deque of heapless, but it requires a capacity type parameter. smoltcp's RingBuffer asks the user to provide a mutable slice. The same RingBuffer can therefore operate on buffers of arbitrary size. This is exactly what I need for my application.

Now I would be happy with any data structure that may be used like a ring buffer, as long as it operates on mutable slices. Be it another Deque-like struct that shares much of its API (what would be a good name for that?), or taking over the original "RingBuffer" with its API.

Before I come up with a PR: Which of these options would the heapless crate accept?

Contributor guide

No contributing guide indexed for this repository

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

The issue names smoltcp::storage::RingBuffer and heapless::Deque as the relevant entry points; compare their APIs and mutable-slice versus capacity models first. Done means the maintainers approve a concrete API and scope for a heapless ring-buffer or deque implementation before a PR is started.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.