pub struct WritePolicyManager { /* private fields */ }Expand description
Write policy manager
Implementations§
Source§impl WritePolicyManager
impl WritePolicyManager
Sourcepub fn new(
policy_type: WritePolicyType,
max_dirty_blocks: usize,
max_dirty_age: Duration,
buffer_size: usize,
) -> Self
pub fn new( policy_type: WritePolicyType, max_dirty_blocks: usize, max_dirty_age: Duration, buffer_size: usize, ) -> Self
Create new write policy manager
Sourcepub fn policy_type(&self) -> WritePolicyType
pub fn policy_type(&self) -> WritePolicyType
Get policy type
Sourcepub fn set_policy_type(&mut self, policy_type: WritePolicyType)
pub fn set_policy_type(&mut self, policy_type: WritePolicyType)
Set policy type
Sourcepub async fn handle_write(
&self,
key: CacheKey,
data: Vec<u8>,
) -> Result<WriteAction>
pub async fn handle_write( &self, key: CacheKey, data: Vec<u8>, ) -> Result<WriteAction>
Handle write operation
Sourcepub fn write_back(&self) -> &WriteBackManager
pub fn write_back(&self) -> &WriteBackManager
Get write-back manager
Sourcepub fn write_buffer(&self) -> &WriteBuffer
pub fn write_buffer(&self) -> &WriteBuffer
Get write buffer
Sourcepub fn amplification(&self) -> &WriteAmplificationTracker
pub fn amplification(&self) -> &WriteAmplificationTracker
Get amplification tracker
Auto Trait Implementations§
impl Freeze for WritePolicyManager
impl !RefUnwindSafe for WritePolicyManager
impl Send for WritePolicyManager
impl Sync for WritePolicyManager
impl Unpin for WritePolicyManager
impl UnsafeUnpin for WritePolicyManager
impl !UnwindSafe for WritePolicyManager
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