Trait PagedMemory

Source
pub trait PagedMemory: Send {
    // Required methods
    fn control(&self) -> &[AtomicU8; 4096];
    fn data_page_count(&self) -> usize;
    fn data(&self, page: usize) -> &[AtomicU8; 4096];
}
Expand description

A trait for ring buffer memory divided into discontiguous pages.

Required Methods§

Source

fn control(&self) -> &[AtomicU8; 4096]

Returns the control page.

Source

fn data_page_count(&self) -> usize

Returns the number of data pages.

Source

fn data(&self, page: usize) -> &[AtomicU8; 4096]

Returns a data page.

For performance reasons, page may be in 0..data_page_count*2, representing the ring logically mapped twice consecutively. The implementation should return the same page for n and n + data_page_count.

Implementors§