pub struct Writer {Show 13 fields
pub header_page_id: PageID,
pub tsn: Tsn,
pub next_page_id: PageID,
pub free_lists_tree_root_id: PageID,
pub events_tree_root_id: PageID,
pub tags_tree_root_id: PageID,
pub next_position: Position,
pub reusable_page_ids: VecDeque<(PageID, Tsn)>,
pub freed_page_ids: VecDeque<PageID>,
pub deserialized: HashMap<PageID, Page>,
pub dirty: HashMap<PageID, Page>,
pub reused_page_ids: VecDeque<(PageID, Tsn)>,
pub verbose: bool,
}Fields§
§header_page_id: PageID§tsn: Tsn§next_page_id: PageID§free_lists_tree_root_id: PageID§events_tree_root_id: PageID§next_position: Position§reusable_page_ids: VecDeque<(PageID, Tsn)>§freed_page_ids: VecDeque<PageID>§deserialized: HashMap<PageID, Page>§dirty: HashMap<PageID, Page>§reused_page_ids: VecDeque<(PageID, Tsn)>§verbose: boolImplementations§
Source§impl Writer
impl Writer
pub fn new( header_page_id: PageID, tsn: Tsn, next_page_id: PageID, free_lists_tree_root_id: PageID, events_tree_root_id: PageID, tags_tree_root_id: PageID, next_position: Position, verbose: bool, ) -> Self
Sourcepub fn issue_position(&mut self) -> Position
pub fn issue_position(&mut self) -> Position
Returns the current issue position and increments the next position.
Returns:
The current issue position.
Sourcepub fn get_page_ref(&mut self, mvcc: &Mvcc, page_id: PageID) -> DCBResult<&Page>
pub fn get_page_ref(&mut self, mvcc: &Mvcc, page_id: PageID) -> DCBResult<&Page>
Retrieves a reference to the page with the given ID.
First checks the dirty pages map, then the deserialized pages map. If the page is not found in either map, it is deserialized from the MVCC.
§Arguments
mvcc: A reference to the MVCC.page_id: The ID of the page to retrieve.
§Returns
A DCBResult containing a reference to the page if found, or an error if the page could not be found.
pub fn get_mut_dirty(&mut self, page_id: PageID) -> DCBResult<&mut Page>
pub fn insert_deserialized(&mut self, page: Page)
pub fn insert_dirty(&mut self, page: Page) -> DCBResult<()>
pub fn alloc_page_id(&mut self) -> PageID
pub fn get_dirty_page_id(&mut self, page_id: PageID) -> DCBResult<PageID>
pub fn append_freed_page_id(&mut self, page_id: PageID)
pub fn find_reusable_page_ids(&mut self, mvcc: &Mvcc) -> DCBResult<()>
pub fn insert_freed_page_id( &mut self, mvcc: &Mvcc, tsn: Tsn, freed_page_id: PageID, ) -> DCBResult<()>
pub fn remove_free_page_id( &mut self, mvcc: &Mvcc, tsn: Tsn, used_page_id: PageID, ) -> DCBResult<()>
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
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