pub struct LineBuffer<T, B>{ /* private fields */ }Expand description
Circular Line Buffer
Implementations§
Source§impl<T, B> LineBuffer<T, B>
impl<T, B> LineBuffer<T, B>
Sourcepub fn new(max: usize) -> Self
pub fn new(max: usize) -> Self
Create new circular buffer of defined data size (bytes)
Note that this is not the amount of entries (lines). LineBuffer will wrap after reaching max bytes or the max amount of lines specified.
Sourcepub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter(&self) -> Iter<'_, T> ⓘ
Returns an iterator over the elements
Note that the first iteration step has some overhead to skip invalid entries.
Sourcepub fn capacity_bytes(&self) -> usize
pub fn capacity_bytes(&self) -> usize
Capacity of total bytes
Note that due to fragmentation it is not trivially possible to get the amount of free bytes
Auto Trait Implementations§
impl<T, B> Freeze for LineBuffer<T, B>
impl<T, B> RefUnwindSafe for LineBuffer<T, B>
impl<T, B> Send for LineBuffer<T, B>where
T: Send,
impl<T, B> Sync for LineBuffer<T, B>where
T: Sync,
impl<T, B> Unpin for LineBuffer<T, B>
impl<T, B> UnwindSafe for LineBuffer<T, B>
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