jamesmunns / bbqueue

A SPSC, lockless, no_std, thread safe, queue, based on BipBuffers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve Documentation RE supported types

drewm1980 opened this issue · comments

Is BBQueue limited to buffering bytes? If so (and I think it is), it's an important limitation to mention in the top-level README. I somehow made it through the video, the blog post, the readme, and halfway through intergrating bbqueue into my code before I discovered the bound:

impl<'a, N> BBBuffer<N>
where
    N: ArrayLength<u8>,

, figured out where ArrayLength came from, studied the generic_array crate a bit, and realized bbqueue probably isn't what I was looking for. I knew bbqueue was implemented for byte buffer DMA use cases, but I'm so used to containers being generic over the contained type that I mistakenly assumed it.

Thanks! Andrew

Hey Andrew,

For a variety of reasons, bbqueue only handles u8s. This is largely due to the ability to avoid things like alignment or other issues.

If this is a problem, I'd probably suggest checking out heapless's Queue structures (spsc or mpmc).

I'll leave this issue open as a reminder to update the docs to make this more clear!