From 1bbc75206a9044c94834159cc90a417beaccbbb6 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 7 Oct 2025 15:51:09 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(eol=5Fcmd):=20introduce=20EolC?= =?UTF-8?q?md=20enum=20for=20message=20disposal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add Trash and Delete variants for specifying end-of-life actions - implement Display trait for EolCmd to provide string representation --- src/eol_cmd.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/eol_cmd.rs diff --git a/src/eol_cmd.rs b/src/eol_cmd.rs new file mode 100644 index 0000000..f7c8697 --- /dev/null +++ b/src/eol_cmd.rs @@ -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"), + } + } +}