Skip to main content

PagedStore

Struct PagedStore 

Source
pub struct PagedStore<S: Store> { /* private fields */ }
Expand description

A simple fixed-size page cache wrapper over any Store.

This is intentionally minimal (no eviction policy yet). It exists to decouple the engine’s random-access reads from the OS file descriptor and provide a hook for future buffer pool work.

Implementations§

Source§

impl<S: Store> PagedStore<S>

Source

pub fn new(inner: S, page_size: u64) -> Self

Source

pub fn into_inner(self) -> S

Source

pub fn page_size(&self) -> u64

Trait Implementations§

Source§

impl<S: Debug + Store> Debug for PagedStore<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Store> Store for PagedStore<S>

Source§

fn len(&self) -> Result<u64, DbError>

Source§

fn read_exact_at(&mut self, offset: u64, buf: &mut [u8]) -> Result<(), DbError>

Source§

fn write_all_at(&mut self, offset: u64, buf: &[u8]) -> Result<(), DbError>

Source§

fn sync(&mut self) -> Result<(), DbError>

Source§

fn truncate(&mut self, len: u64) -> Result<(), DbError>

Shrink or grow the logical file to len bytes (used for crash recovery truncation).
Source§

fn is_empty(&self) -> Result<bool, DbError>

Auto Trait Implementations§

§

impl<S> Freeze for PagedStore<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for PagedStore<S>
where S: RefUnwindSafe,

§

impl<S> Send for PagedStore<S>
where S: Send,

§

impl<S> Sync for PagedStore<S>
where S: Sync,

§

impl<S> Unpin for PagedStore<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for PagedStore<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for PagedStore<S>
where S: UnwindSafe,

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.