[][src]Struct jack::RingBufferReader

pub struct RingBufferReader { /* fields omitted */ }

Read end of the ring buffer. Can only be used from one thread (can be different from the write thread).

Implementations

impl RingBufferReader[src]

pub fn get_vector(&self) -> (&[u8], &[u8])[src]

Fill a data structure with a description of the current readable data held in the ringbuffer. This description is returned in a two slices. Two slices are needed because the data to be read may be split across the end of the ringbuffer. The first slice represents the bytes ready to be read. If the second slice is not empty, it is the continuation of the data that ended in the first slices. For convenience, consider using peek_iter instead.

pub fn read_buffer(&mut self, buf: &mut [u8]) -> usize[src]

Read data from the ringbuffer. Returns: the number of bytes read, which may range from 0 to buf.len().

pub fn peek(&self, buf: &mut [u8]) -> usize[src]

Read data from the ringbuffer. Opposed to read_buffer() this function does not move the read pointer. Thus it's a convenient way to inspect data in the ringbuffer in a continous fashion. The price is that the data is copied into a user provided buffer. For "raw" non-copy inspection of the data in the ringbuffer use get_vector() or peek_iter. Returns: the number of bytes read, which may range from 0 to buf.len()

pub fn advance(&mut self, cnt: usize)[src]

Advance the read pointer. use this after peek/peek_iter or get_vector to advance the buffer pointer.

pub fn space(&self) -> usize[src]

Return the number of bytes available for reading.

pub fn peek_iter<'a>(&'a self) -> Chain<Iter<'a, u8>, Iter<'a, u8>>[src]

Iterator that goes over all the data available to read.

Trait Implementations

impl Drop for RingBufferReader[src]

impl Read for RingBufferReader[src]

impl Send for RingBufferReader[src]

impl Sync for RingBufferReader[src]

Auto Trait Implementations

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, 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.