[][src]Struct ssd1362::terminal::ringbuffer::Ringbuffer

pub struct Ringbuffer<N: ArrayLength<u8>> { /* fields omitted */ }

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.