Struct rustdb::blockpagestg::BlockPageStg

source ·
pub struct BlockPageStg {
    pub ds: DividedStg,
    /* private fields */
}
Expand description

Implementation of PageStorage using DividedStg.

Fields§

§ds: DividedStg

Underlying Divided Storage.

Implementations§

source§

impl BlockPageStg

source

pub fn new(stg: Box<dyn Storage>, lim: &Limits) -> Box<Self>

Construct from specified Storage and limits.

Trait Implementations§

source§

impl PageStorage for BlockPageStg

source§

fn is_new(&self) -> bool

Is the underlying storage new?
source§

fn new_page(&mut self) -> u64

Make a new page, result is page number.
source§

fn drop_page(&mut self, pn: u64)

Drop page number.
source§

fn info(&self) -> Box<dyn PageStorageInfo>

Information about page sizes.
source§

fn set_page(&mut self, pn: u64, data: Data)

Set contents of page.
source§

fn get_page(&self, pn: u64) -> Data

Get contents of page.
source§

fn size(&self, pn: u64) -> usize

Get page size (for repacking).
source§

fn save(&mut self)

Save pages to underlying storage.
source§

fn rollback(&mut self)

Undo changes since last save ( but set_page/renumber cannot be undone, only new_page and drop_page can be undone ).
source§

fn wait_complete(&self)

Wait until save is complete.
source§

fn get_free(&mut self) -> (FxHashSet<u64>, u64)

Get set of free pages and number of pages ever allocated ( for VERIFY builtin function ).
source§

fn load_free_pages(&mut self) -> Option<u64>

Load free pages in preparation for page renumbering. Returns number of used pages or None if there are no free pages.
source§

fn renumber(&mut self, pn: u64) -> u64

Renumber page.
source§

fn set_alloc_pn(&mut self, target: u64)

Final part of page renumber operation.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.