pub struct QuotaManagerNotifier { /* private fields */ }Expand description
Used to initiate a QuotaManager eviction, and to tell it about
the creation and access of files. Send and Sync.
Implementations§
Source§impl QuotaManagerNotifier
impl QuotaManagerNotifier
Sourcepub fn trigger_eviction_if_needed(&self)
pub fn trigger_eviction_if_needed(&self)
Trigger an eviction. The eviction runs asynchronously in a single shared eviction task and uses the current eviction settings.
Sourcepub fn on_file_created(
&self,
path: &Path,
size_in_bytes: u64,
creation_time: SystemTime,
)
pub fn on_file_created( &self, path: &Path, size_in_bytes: u64, creation_time: SystemTime, )
You must call this whenever a new file gets added to the managed directory.
Calls for files outside the managed directory are ignored.
Sourcepub fn on_file_accessed(&self, path: &Path, access_time: SystemTime)
pub fn on_file_accessed(&self, path: &Path, access_time: SystemTime)
You must call this whenever a file in the managed directory is accessed.
Calls for files outside the managed directory are ignored.
Sourcepub fn on_file_deleted(&self, path: &Path)
pub fn on_file_deleted(&self, path: &Path)
You usually don’t need to call this because we expect you to leave any
deleting to the QuotaManager. But if you do delete any files in the
managed directory yourself, call this method so that the QuotaManager
can update its information.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuotaManagerNotifier
impl RefUnwindSafe for QuotaManagerNotifier
impl Send for QuotaManagerNotifier
impl Sync for QuotaManagerNotifier
impl Unpin for QuotaManagerNotifier
impl UnwindSafe for QuotaManagerNotifier
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