pub struct CleanupManager { /* private fields */ }Expand description
Cleanup manager for temporary files
Implementations§
Source§impl CleanupManager
impl CleanupManager
Sourcepub fn add_temp_directory<P: Into<PathBuf>>(self, path: P) -> Self
pub fn add_temp_directory<P: Into<PathBuf>>(self, path: P) -> Self
Add a directory to monitor for cleanup
Sourcepub fn with_max_age(self, max_age: Duration) -> Self
pub fn with_max_age(self, max_age: Duration) -> Self
Set maximum age for temporary files
Sourcepub fn with_cleanup_interval(self, interval: Duration) -> Self
pub fn with_cleanup_interval(self, interval: Duration) -> Self
Set cleanup interval
Sourcepub async fn start(&self) -> StorageResult<JoinHandle<()>>
pub async fn start(&self) -> StorageResult<JoinHandle<()>>
Start the cleanup background task
Sourcepub async fn run_once(&self) -> StorageResult<CleanupStats>
pub async fn run_once(&self) -> StorageResult<CleanupStats>
Run cleanup once
Trait Implementations§
Source§impl Debug for CleanupManager
impl Debug for CleanupManager
Auto Trait Implementations§
impl Freeze for CleanupManager
impl RefUnwindSafe for CleanupManager
impl Send for CleanupManager
impl Sync for CleanupManager
impl Unpin for CleanupManager
impl UnsafeUnpin for CleanupManager
impl UnwindSafe for CleanupManager
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