Module spsc

Module spsc 

Source
Expand description

High-performance SPSC Ring Buffer with stack/heap optimization

基于栈/堆优化的高性能 SPSC 环形缓冲区

This implementation uses FixedVec to store data on the stack for small capacities (≤32), avoiding heap allocation overhead and improving new() performance.

此实现使用 FixedVec 在栈上存储小容量数据(≤32),避免堆分配开销,提升 new() 性能。

Structs§

Consumer
Consumer half of the ring buffer
Drain
Draining iterator for the ring buffer
Producer
Producer half of the ring buffer
SharedData
Shared data between producer and consumer

Enums§

PopError
Ring buffer error for pop operations
PushError
Ring buffer error for push operations

Functions§

new
Create a new ring buffer with the specified capacity