| Crates.io | ourobuf |
| lib.rs | ourobuf |
| version | 0.1.1 |
| created_at | 2025-01-23 22:28:57.286479+00 |
| updated_at | 2025-01-23 22:28:57.286479+00 |
| description | A no_std circular buffer with constant-time operations |
| homepage | |
| repository | https://github.com/xvi-xv-xii-ix-xxii-ix-xiv/ourobuf |
| max_upload_size | |
| id | 1528561 |
| size | 15,008 |
Thread-safe circular buffer for embedded systems and high-performance applications
no_std supportuse 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(())
}