[][src]Trait pagecache::Materializer

pub trait Materializer {
    type PageFrag;
    fn new(config: Config) -> Self
    where
        Self: Sized
;
fn merge<'a, I>(&'a self, frags: I) -> Self::PageFrag
    where
        I: IntoIterator<Item = &'a Self::PageFrag>
;
fn size_in_bytes(&self, frag: &Self::PageFrag) -> usize; }

A user of a PageCache needs to provide a Materializer which handles the merging of page fragments.

Associated Types

type PageFrag

The possibly fragmented page, written to log storage sequentially, and read in parallel from multiple locations on disk when serving a request to read the page. These will be merged to a single version at read time, and possibly cached.

Loading content...

Required methods

fn new(config: Config) -> Self where
    Self: Sized

Create a new Materializer with the previously recovered state if any existed.

fn merge<'a, I>(&'a self, frags: I) -> Self::PageFrag where
    I: IntoIterator<Item = &'a Self::PageFrag>, 

Used to merge chains of partial pages into a form that is useful for the PageCache owner.

fn size_in_bytes(&self, frag: &Self::PageFrag) -> usize

Used to determine the size of the value for caching purposes.

Loading content...

Implementors

impl Materializer for NullMaterializer[src]

type PageFrag = ()

Loading content...