Skip to main content

Module ring_specialization

Module ring_specialization 

Source
Expand description

Numeric specializations for BoundedRingBuffer<u8>.

This module provides typed enqueue/peek/dequeue helpers that convert values to and from big-endian bytes.

§Endianness

All generated methods use network byte order (big-endian), which makes this API convenient for protocol frames and wire formats.

§Example

use refraction_types::ring_buffer::BoundedRingBuffer;

let mut rb = BoundedRingBuffer::<u8>::with_capacity(16);
rb.enqueue_u16(0xBEEF);
rb.enqueue_i32(-42);

assert_eq!(rb.peek_u16(), Some(0xBEEF));
assert_eq!(rb.dequeue_u16(), Some(0xBEEF));
assert_eq!(rb.dequeue_i32(), Some(-42));