This library provides a interface to create database pages.
A page is a fixed size buffer that can be used to store data.
Example
In your cargo.toml:
[dependencies]
flex-page = "0.1"
use Pages;
// First generic argument is the page number type. Number of page that can be stored in the file.
// Second generic argument is the size of the page.
let pages: = open?;
// Create a page.
pages.create.await?;
// Overwrite a page.
pages.write.await?;
// Reading a page and write to it.
// It also lock the page num. So, this page can't be read by other thread.
let mut page = pages.goto.await?;
assert_eq!;
page.buf = ;
// Write to the page.
// It drops the lock. So, this page can be accessable by other thread.
page.write.await?;
// Read a page.
assert_eq!;