pub struct Pager {
pub reader: Arc<File>,
pub writer: Mutex<BufWriter<File>>,
pub writer_raw_fd: RawFd,
pub page_size: usize,
pub is_file_new: bool,
/* private fields */
}Fields§
§reader: Arc<File>§writer: Mutex<BufWriter<File>>§writer_raw_fd: RawFd§page_size: usize§is_file_new: boolImplementations§
Source§impl Pager
impl Pager
pub fn new(path: &Path, page_size: usize) -> Result<Self>
pub fn read_page(&self, page_id: PageID) -> Result<Vec<u8>>
pub fn read_page_mmap_slice(&self, page_id: PageID) -> Result<MappedPage>
pub fn write_page(&self, page_id: PageID, page: &[u8]) -> DCBResult<()>
pub fn flush(&self) -> Result<()>
Auto Trait Implementations§
impl !Freeze for Pager
impl RefUnwindSafe for Pager
impl Send for Pager
impl Sync for Pager
impl Unpin for Pager
impl UnwindSafe for Pager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more