✨ feat(eol_cmd): introduce EolCmd enum for message disposal
- add Trash and Delete variants for specifying end-of-life actions - implement Display trait for EolCmd to provide string representation
This commit is contained in:
committed by
Jeremiah Russell
parent
9c4e1c989d
commit
1bbc75206a
22
src/eol_cmd.rs
Normal file
22
src/eol_cmd.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use std::fmt;
|
||||
|
||||
/// End of life command
|
||||
/// - Trash - move the message to the trash to be automatically deleted by Google
|
||||
/// - Delete - delete the message immediately without allowing rescue from trash
|
||||
#[derive(Debug, Default)]
|
||||
pub enum EolCmd {
|
||||
#[default]
|
||||
/// Move the message to the trash
|
||||
Trash,
|
||||
/// Delete the message immediatly
|
||||
Delete,
|
||||
}
|
||||
|
||||
impl fmt::Display for EolCmd {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
EolCmd::Trash => write!(f, "trash"),
|
||||
EolCmd::Delete => write!(f, "delete"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user