From 20fbae74e67ff2c6db85b96edd2a3646d3cd8ed5 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Oct 2025 17:30:45 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(processor):=20add=20execute=20?= =?UTF-8?q?flag=20to=20GmailClient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add the execute flag to control the execution of the GmailClient - implement setter function for the execute flag --- src/processor.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/processor.rs b/src/processor.rs index 6292d1b..91014b8 100644 --- a/src/processor.rs +++ b/src/processor.rs @@ -56,6 +56,8 @@ use crate::{ /// Rules processor to apply the configured rules to the mailbox. pub trait RuleProcessor { + /// Set the execute flag in the client + fn set_execute(&mut self, value: bool); /// Delete messages fn delete_messages( &mut self, @@ -83,8 +85,13 @@ impl RuleProcessor for GmailClient { // } /// Add Action to the Client for processing - fn set_rule(&mut self, rule: EolRule) { - self.rule = Some(rule); + fn set_rule(&mut self, value: EolRule) { + self.rule = Some(value); + } + + /// Set the execute flag + fn set_execute(&mut self, value: bool) { + self.execute = value; } /// The action set in the rule