utaal / spsc-bip-buffer

A concurrent, spsc ring-buffer with sized reservations
Apache License 2.0
96 stars 14 forks source link

WIP: Allow generic types instead of only u8 #10

Closed Rikorose closed 3 years ago

Rikorose commented 3 years ago

This would enable storing other data types like i16 or f32. Tests for these types would be good I guess. I am not sure about variable size types like String, Vec etc.

What do you think?

I realized, the diff is not as clean, because I ran cargo fmt. Should I revert these changes? I could also do another PR with formatting and clippy fixes.

pindaroso commented 3 years ago

Bump!

utaal commented 3 years ago

Hi, thanks for the reminder! Can you explain what's your use case for this? I see the library as mostly a tool for raw data transfer, where we're transferring a sequence of bytes that represent some message and we want those bytes to be contiguous (for example, for zero-copy parsing): I don't exactly see why other types would be useful, but you may of course have another valid use-case.

Rikorose commented 3 years ago

I wanted to use this for audio data. However, I switched to dasp_ring_buffer, recently. Feel free to reuse this PR if you plan to add such a feature.