Struct memory_pager::Pager
[−]
[src]
pub struct Pager { pub page_size: usize, pub pages: Vec<Option<Page>>, // some fields omitted }
Memory pager instance. Manages Page
instances.
Fields
page_size: usize
The size of each page held in memory.
pages: Vec<Option<Page>>
A vector of pages that are held in memory.
Methods
impl Pager
[src]
pub fn new(page_size: usize) -> Self
[src]
pub fn with_pages(page_size: usize, pages: Vec<Option<Page>>) -> Self
[src]
Create a new Pager
instance with a page_size
and pages
. Useful
to restore a Pager
instance from disk.
pub fn get(&mut self, page_num: usize) -> &Page
[src]
Get a Page
. The page will be allocated on first access.
Trait Implementations
impl Debug for Pager
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more