#[repr(C)]pub struct ring_buf {
pub buffer: *mut u8,
pub size: u16,
pub read_idx: u16,
pub write_idx: u16,
}Expand description
@brief A structure to represent a ring buffer.
The struct stores the buffer capacity @p size (N). No slot is sacrificed: @p read_idx and @p write_idx are free-running indices in [0, 2N), so the full and empty states are disambiguated by their lap rather than by a reserved slot. The user-visible capacity equals @p size.
Fields§
§buffer: *mut u8@cond INTERNAL_HIDDEN
size: u16§read_idx: u16§write_idx: u16Trait Implementations§
Auto Trait Implementations§
impl !Send for ring_buf
impl !Sync for ring_buf
impl Freeze for ring_buf
impl RefUnwindSafe for ring_buf
impl Unpin for ring_buf
impl UnsafeUnpin for ring_buf
impl UnwindSafe for ring_buf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more