pub struct MemoryOptimizer { /* private fields */ }Expand description
Memory optimization manager
Implementations§
Source§impl MemoryOptimizer
impl MemoryOptimizer
Sourcepub fn new(config: MemoryOptimizationConfig) -> Self
pub fn new(config: MemoryOptimizationConfig) -> Self
Create a new memory optimizer
Sourcepub fn record_access(&self, page_id: PageId)
pub fn record_access(&self, page_id: PageId)
Record a page access
Sourcepub fn get_prefetch_recommendations(&self, current_page: PageId) -> Vec<PageId> ⓘ
pub fn get_prefetch_recommendations(&self, current_page: PageId) -> Vec<PageId> ⓘ
Get prefetch recommendations
Sourcepub fn acquire_buffer(&self) -> Vec<u8> ⓘ
pub fn acquire_buffer(&self) -> Vec<u8> ⓘ
Acquire a buffer from the memory pool
Sourcepub fn release_buffer(&self, buffer: Vec<u8>)
pub fn release_buffer(&self, buffer: Vec<u8>)
Release a buffer back to the memory pool
Sourcepub fn pool_stats(&self) -> Option<MemoryPoolStats>
pub fn pool_stats(&self) -> Option<MemoryPoolStats>
Get memory pool statistics (if enabled)
Sourcepub fn stats(&self) -> &MemoryOptimizerStats
pub fn stats(&self) -> &MemoryOptimizerStats
Get optimizer statistics
Sourcepub fn is_sequential_access(&self) -> bool
pub fn is_sequential_access(&self) -> bool
Check if access pattern is sequential
Sourcepub fn reset_pattern_detection(&self)
pub fn reset_pattern_detection(&self)
Reset access pattern detection
Sourcepub fn recommended_readahead(&self) -> usize
pub fn recommended_readahead(&self) -> usize
Get recommended readahead distance
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MemoryOptimizer
impl !RefUnwindSafe for MemoryOptimizer
impl !UnwindSafe for MemoryOptimizer
impl Send for MemoryOptimizer
impl Sync for MemoryOptimizer
impl Unpin for MemoryOptimizer
impl UnsafeUnpin for MemoryOptimizer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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