| Crates.io | nsrb |
| lib.rs | nsrb |
| version | 1.0.0 |
| created_at | 2024-10-23 19:44:06.471758+00 |
| updated_at | 2024-10-23 19:44:06.471758+00 |
| description | Nifty Simple Ring Buffer (aka circular buffer) is a no_std library that provides 2 macros to easily create fixed circular buffer on the stack. |
| homepage | |
| repository | https://github.com/NickelAngeStudio/nsrb |
| max_upload_size | |
| id | 1420538 |
| size | 34,431 |
Nifty Simple Ring Buffer (aka circular buffer) is a no_std library that provides 2 macros to easily create fixed circular buffer on the stack.
See crate documentation for more informations.
#[macro_use] extern crate nsrb;
#[derive(Clone, Copy, Debug)]
pub struct LogEntry {
pub time_date : usize,
pub entry : [char;256]
}
impl Default for LogEntry {
fn default() -> Self { LogEntry { time_date : 0, entry : [' ';256] } }
}
// Create a Ring buffer for LogEntry
nsrb::ring!(#[derive(Debug)] pub(crate) LogChecked[LogEntry; 10]);
fn main() {
let log = LogChecked::new();
}