pub struct RetentionManager { /* private fields */ }Expand description
Manages event retention and cleanup
Implementations§
Source§impl RetentionManager
impl RetentionManager
Sourcepub fn new(policy: RetentionPolicy, events_path: PathBuf) -> Self
pub fn new(policy: RetentionPolicy, events_path: PathBuf) -> Self
Create a new retention manager with the given policy
Sourcepub fn with_default_policy(events_path: PathBuf) -> Self
pub fn with_default_policy(events_path: PathBuf) -> Self
Create with default policy
Sourcepub async fn with_global_storage(repo_path: &Path, job_id: &str) -> Result<Self>
pub async fn with_global_storage(repo_path: &Path, job_id: &str) -> Result<Self>
Create with global storage support
Sourcepub fn from_config_file(
config_path: &Path,
events_path: PathBuf,
) -> Result<Self>
pub fn from_config_file( config_path: &Path, events_path: PathBuf, ) -> Result<Self>
Load policy from configuration file
Sourcepub async fn analyze_retention(&self) -> Result<RetentionAnalysis>
pub async fn analyze_retention(&self) -> Result<RetentionAnalysis>
Perform dry-run analysis without modifying files
Sourcepub async fn apply_retention(&self) -> Result<RetentionStats>
pub async fn apply_retention(&self) -> Result<RetentionStats>
Apply retention policy to events file
Sourcepub fn policy(&self) -> &RetentionPolicy
pub fn policy(&self) -> &RetentionPolicy
Get current retention policy
Sourcepub fn set_policy(&mut self, policy: RetentionPolicy)
pub fn set_policy(&mut self, policy: RetentionPolicy)
Update retention policy
Sourcepub fn save_policy_to_file(&self, config_path: &Path) -> Result<()>
pub fn save_policy_to_file(&self, config_path: &Path) -> Result<()>
Save policy to configuration file
Auto Trait Implementations§
impl Freeze for RetentionManager
impl RefUnwindSafe for RetentionManager
impl Send for RetentionManager
impl Sync for RetentionManager
impl Unpin for RetentionManager
impl UnsafeUnpin for RetentionManager
impl UnwindSafe for RetentionManager
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more