pub struct CleanupStateStore { /* private fields */ }Expand description
Manages cleanup state files keyed by session id.
Implementations§
Source§impl CleanupStateStore
impl CleanupStateStore
pub fn new() -> Result<Self>
pub fn with_dir(dir: impl AsRef<Path>) -> Result<Self>
Sourcepub fn load_or_new(&self, session_id: &str) -> Result<CleanupState>
pub fn load_or_new(&self, session_id: &str) -> Result<CleanupState>
Load state for a session, or return a freshly-initialized state if none exists yet.
pub fn save(&self, state: &CleanupState) -> Result<()>
pub fn remove(&self, session_id: &str)
pub fn exists(&self, session_id: &str) -> bool
Sourcepub fn list_pending(&self) -> Vec<CleanupState>
pub fn list_pending(&self) -> Vec<CleanupState>
Return every cleanup state currently on disk that still has at least one unresolved failure. Used as a “cleanup backlog” guard before starting a fresh –ephemeral session so users don’t quietly pile up orphaned resources. States with only successful deletes (which is an interim state during cleanup) are skipped — the file would be removed on next full success anyway.
Auto Trait Implementations§
impl Freeze for CleanupStateStore
impl RefUnwindSafe for CleanupStateStore
impl Send for CleanupStateStore
impl Sync for CleanupStateStore
impl Unpin for CleanupStateStore
impl UnsafeUnpin for CleanupStateStore
impl UnwindSafe for CleanupStateStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.