Crate ourobuf

Source
Expand description

Thread-safe circular buffer implementation for embedded systems and high-performance applications

§Key Features

  • 🛡️ 100% Safe Rust with no_std support
  • ⚡ Constant-time O(1) operations
  • 🔒 Thread-safe using spinlock-based Mutex
  • 📏 Configurable size via const generics
  • 🔄 Seamless integration with heapless::Vec

§Use Cases

  • Real-time data streaming (sensors, network packets)
  • Interrupt-safe logging in embedded systems
  • Multi-producer/single-consumer (MPSC) communication
  • Lock-free communication between threads/cores

§Example

use ourobuf::OuroBuffer;

let buf = OuroBuffer::<256>::new();

// Write data from multiple threads
buf.push(b"Hello").unwrap();

// Read into mutable slice
let mut output = [0u8; 5];
let read = buf.pop(&mut output);
assert_eq!(&output[..read], b"Hello");

Structs§

OuroBuffer
Thread-safe circular buffer implementation

Enums§

OuroBufferError
Error types for buffer operations