Skip to main content

BlockPageStg

Struct BlockPageStg 

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

Implementation of PageStorage.

Fields§

§ds: DividedStg

Underlying Divided Storage.

Implementations§

Source§

impl BlockPageStg

Source

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

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: Arc<Vec<u8>>)

Set contents of page.
Source§

fn get_page(&self, pn: u64) -> Arc<Vec<u8>>

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) -> (HashSet<u64, BuildHasherDefault<FxHasher>>, 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>,

Source§

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>,

Source§

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.