pub struct WriteBackManager { /* private fields */ }Expand description
Write-back manager with dirty tracking
Implementations§
Source§impl WriteBackManager
impl WriteBackManager
Sourcepub fn new(max_dirty_blocks: usize, max_dirty_age: Duration) -> Self
pub fn new(max_dirty_blocks: usize, max_dirty_age: Duration) -> Self
Create new write-back manager
Sourcepub fn set_coalescing(&mut self, enabled: bool)
pub fn set_coalescing(&mut self, enabled: bool)
Enable or disable write coalescing
Sourcepub async fn get_flush_candidates(&self) -> Vec<DirtyBlock>
pub async fn get_flush_candidates(&self) -> Vec<DirtyBlock>
Get blocks that need flushing
Sourcepub async fn mark_clean(&self, key: &CacheKey)
pub async fn mark_clean(&self, key: &CacheKey)
Mark block as clean (after flush)
Sourcepub async fn dirty_count(&self) -> usize
pub async fn dirty_count(&self) -> usize
Get dirty block count
Sourcepub async fn dirty_bytes(&self) -> usize
pub async fn dirty_bytes(&self) -> usize
Get total dirty bytes
Sourcepub async fn oldest_dirty_age(&self) -> Option<Duration>
pub async fn oldest_dirty_age(&self) -> Option<Duration>
Get oldest dirty block age
Auto Trait Implementations§
impl Freeze for WriteBackManager
impl !RefUnwindSafe for WriteBackManager
impl Send for WriteBackManager
impl Sync for WriteBackManager
impl Unpin for WriteBackManager
impl UnsafeUnpin for WriteBackManager
impl !UnwindSafe for WriteBackManager
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> 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