pub struct PageFile {
pub num_pages: u32,
pub version: u32,
/* private fields */
}Fields§
§num_pages: u32§version: u32File-format version read from the header. FILE_VERSION for files
created by this build; an older value if open accepted a legacy
version (see LEGACY_VERSIONS).
Implementations§
Source§impl PageFile
impl PageFile
pub fn create(path: &Path) -> Result<Self, MqdbError>
pub fn open(path: &Path) -> Result<Self, MqdbError>
pub fn read_page(&mut self, page_id: u32) -> Result<[u8; 8192], MqdbError>
pub fn write_page( &mut self, page_id: u32, data: &[u8; 8192], ) -> Result<(), MqdbError>
pub fn append_page(&mut self, data: &[u8; 8192]) -> Result<u32, MqdbError>
Sourcepub fn sync_header(&mut self) -> Result<(), MqdbError>
pub fn sync_header(&mut self) -> Result<(), MqdbError>
Persists num_pages if it changed since the last write. Must run
before the file is reopened from disk (see Storage::flush_catalog).
Auto Trait Implementations§
impl Freeze for PageFile
impl RefUnwindSafe for PageFile
impl Send for PageFile
impl Sync for PageFile
impl Unpin for PageFile
impl UnsafeUnpin for PageFile
impl UnwindSafe for PageFile
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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