1 unstable release
new 0.1.1 | Jan 23, 2025 |
---|
#350 in Embedded development
103 downloads per month
14KB
171 lines
๐ Ourobuf
Thread-safe circular buffer for embedded systems and high-performance applications
Features โจ
- ๐ก๏ธ 100% Safe Rust with
no_std
support - โก Constant-time O(1) operations
- ๐ Spinlock-based thread safety
- ๐ Configurable size via const generics
- ๐ Heapless Vec integration
- ๐ Zero allocations
- ๐งผ Memory zeroization
Designed For ๐ฏ
- Real-time data streaming (sensors, network packets)
- Interrupt-safe logging
- Lock-free inter-thread communication
- Embedded systems (no_std)
- High-throughput data pipelines
Quick Start ๐
use ourobuf::OuroBuffer;
fn main() -> Result<(), ourobuf::OuroBufferError> {
// Create 256-byte buffer
let buf = OuroBuffer::<256>::new();
// Write data
buf.push(b"Hello")?;
// Read data
let mut output = [0u8; 5];
let read = buf.pop(&mut output);
assert_eq!(&output[..read], b"Hello");
Ok(())
}
Dependencies
~250KB