pub struct RingbufRw<'a> { /* private fields */ }Implementations§
Source§impl<'a> RingbufRw<'a>
impl<'a> RingbufRw<'a>
pub fn make(tail: &'a mut usize, head: &'a usize, buffer: &'a mut [u8]) -> Self
Sourcepub unsafe fn new(size: usize, data: *mut u8) -> Self
pub unsafe fn new(size: usize, data: *mut u8) -> Self
§Safety
This function is used to create a ringbuffer from a pointer and length It is up to the caller to ensure the size argument is correct
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
pub fn get_curr_bytes(&self) -> usize
pub fn get_head(&self) -> usize
pub fn get_tail(&self) -> usize
pub fn set_tail(&mut self, num: usize)
pub fn get_size(&self) -> usize
pub fn empty_slots_left(&self) -> usize
pub fn push(&mut self, msg: &[u8]) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for RingbufRw<'a>
impl<'a> RefUnwindSafe for RingbufRw<'a>
impl<'a> Send for RingbufRw<'a>
impl<'a> Sync for RingbufRw<'a>
impl<'a> Unpin for RingbufRw<'a>
impl<'a> !UnwindSafe for RingbufRw<'a>
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