Files
cull-gmail/src/retention.rs
Jeremiah Russell 92e88c4261 📝 docs(retention): add documentation for the retention struct
- add documentation for the `new` function
2025-10-08 07:56:41 +01:00

38 lines
741 B
Rust

mod message_age;
pub use message_age::MessageAge;
/// Define retention period and flag to indicate if label should be generated
#[derive(Debug)]
pub struct Retention {
age: MessageAge,
generate_label: bool,
}
impl Default for Retention {
fn default() -> Self {
Self {
age: MessageAge::Years(5),
generate_label: true,
}
}
}
impl Retention {
/// Create a new retention struct
pub fn new(age: MessageAge, generate_label: bool) -> Self {
Retention {
age,
generate_label,
}
}
pub(crate) fn age(&self) -> &MessageAge {
&self.age
}
pub(crate) fn generate_label(&self) -> bool {
self.generate_label
}
}