pub struct PagePool { /* private fields */ }Expand description
A page pool of currently unused pages available for use in Pages.
Implementations§
Source§impl PagePool
impl PagePool
pub fn new_for_test() -> Self
Sourcepub fn new(max_size: Option<usize>) -> Self
pub fn new(max_size: Option<usize>) -> Self
Returns a new page pool with max_size bytes rounded down to the nearest multiple of 64 KiB.
if no size is provided, a default of 1 page is used.
Sourcepub fn take_with_fixed_row_size(&self, fixed_row_size: Size) -> Box<Page>
pub fn take_with_fixed_row_size(&self, fixed_row_size: Size) -> Box<Page>
Takes a Page from the pool or creates a new one.
The returned page supports fixed rows of size fixed_row_size.
Sourcepub fn take_deserialize_from(
&self,
buf: &[u8],
) -> Result<Box<Page>, DecodeError>
pub fn take_deserialize_from( &self, buf: &[u8], ) -> Result<Box<Page>, DecodeError>
Deserialize a page from buf but reuse the allocations in the pool.
Sourcepub fn dropped_pages_count(&self) -> usize
pub fn dropped_pages_count(&self) -> usize
Returns the number of pages dropped by the pool because the pool was at capacity.
Sourcepub fn new_pages_allocated_count(&self) -> usize
pub fn new_pages_allocated_count(&self) -> usize
Returns the number of fresh pages allocated through the pool.
Sourcepub fn pages_reused_count(&self) -> usize
pub fn pages_reused_count(&self) -> usize
Returns the number of pages reused from the pool.
Sourcepub fn pages_returned_count(&self) -> usize
pub fn pages_returned_count(&self) -> usize
Returns the number of pages returned to the pool.
Trait Implementations§
Source§impl<'de> DeserializeSeed<'de> for &PagePool
impl<'de> DeserializeSeed<'de> for &PagePool
Source§fn deserialize<D: Deserializer<'de>>(
self,
de: D,
) -> Result<Self::Output, D::Error>
fn deserialize<D: Deserializer<'de>>( self, de: D, ) -> Result<Self::Output, D::Error>
Equivalent to the more common
Deserialize::deserialize associated function,
except with some initial piece of data (the seed self) passed in.Source§impl MemoryUsage for PagePool
impl MemoryUsage for PagePool
Source§fn heap_usage(&self) -> usize
fn heap_usage(&self) -> usize
The heap memory usage of this type. The default implementation returns 0.
Source§impl<'de> ProductVisitor<'de> for &PagePool
impl<'de> ProductVisitor<'de> for &PagePool
Source§fn product_name(&self) -> Option<&str>
fn product_name(&self) -> Option<&str>
Returns the name of the product, if any.
Source§fn product_len(&self) -> usize
fn product_len(&self) -> usize
Returns the length of the product.
Source§fn visit_seq_product<A: SeqProductAccess<'de>>(
self,
prod: A,
) -> Result<Self::Output, A::Error>
fn visit_seq_product<A: SeqProductAccess<'de>>( self, prod: A, ) -> Result<Self::Output, A::Error>
The input contains an unnamed product.
Source§fn visit_named_product<A: NamedProductAccess<'de>>(
self,
_: A,
) -> Result<Self::Output, A::Error>
fn visit_named_product<A: NamedProductAccess<'de>>( self, _: A, ) -> Result<Self::Output, A::Error>
The input contains a named product.
Source§fn product_kind(&self) -> ProductKind
fn product_kind(&self) -> ProductKind
Returns the kind of the product.
Auto Trait Implementations§
impl Freeze for PagePool
impl RefUnwindSafe for PagePool
impl Send for PagePool
impl Sync for PagePool
impl Unpin for PagePool
impl UnwindSafe for PagePool
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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