primitive-buffer 0.1.0

A stack-based buffer with fixed capacity for primitives.
Documentation
  • Coverage
  • 92.86%
    13 out of 14 items documented13 out of 13 items with examples
  • Size
  • Source code size: 22.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 536.9 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • stitzed/primitive-buffer
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • stitzed

primitive-buffer

A stack-based buffer with fixed capacity for primitives.

Uses uninitialized memory to avoid the cost of filling the buffer with default values.

Examples

use primitive_buffer::Buffer;

let mut buffer: Buffer<u8, 8> = Buffer::new();

buffer.push(1);
buffer.push(2);

assert_eq!(buffer.len(), 2);

assert_eq!(buffer.pop(), Some(2));
assert_eq!(buffer.len(), 1);

buffer.clear();

assert!(buffer.is_empty());