[−][src]Struct ssd1362::terminal::ringbuffer::Ringbuffer
Implementations
impl<N: ArrayLength<u8>> Ringbuffer<N>
[src]
pub fn new() -> Self
[src]
pub fn try_add(&mut self, bytes: &[u8]) -> Result<(), Error>
[src]
try to add slice of bytes as a new element throws error if there is no space in the buffer
pub fn add(&mut self, bytes: &[u8])
[src]
pub fn iter(&self, offset: usize) -> impl Iterator<Item = &[u8]>
[src]
pub fn reverse_iter(&self, offset: usize) -> impl Iterator<Item = &[u8]>
[src]
pub fn element(&self, index: usize) -> Option<&[u8]>
[src]
pub fn pop(&mut self) -> bool
[src]
Pop one element from the front of the buffer. That is, the element that was added first. Returns bool indicating whether anything was popped or not.
pub fn used(&self) -> usize
[src]
pub fn wrap_wp(&mut self, size: usize)
[src]
Returns optimal write pointer for given element size It makes sure that elements are always in continuous memory
pub fn free(&self) -> usize
[src]
Get number of free elements in ringbuffer
Trait Implementations
impl<N: ArrayLength<u8>> Debug for Ringbuffer<N>
[src]
Auto Trait Implementations
impl<N> Send for Ringbuffer<N>
impl<N> Sync for Ringbuffer<N>
impl<N> Unpin for Ringbuffer<N> where
<N as ArrayLength<u8>>::ArrayType: Unpin,
<N as ArrayLength<u8>>::ArrayType: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,