From b2a2de09815c49d091ae83641ce310cf18421fd1 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Oct 2025 16:47:54 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(message=5Flist):=20enhance=20m?= =?UTF-8?q?essage=20list=20trait=20with=20documentation=20and=20functional?= =?UTF-8?q?ities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add documentation to all methods - add `hub`, `label_ids`, `message_ids`, `messages`, `set_query`, `add_labels_ids`, `add_labels`, `max_results`, `set_max_results` methods to the `MessageList` trait --- src/message_list.rs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/message_list.rs b/src/message_list.rs index 380029f..9912e40 100644 --- a/src/message_list.rs +++ b/src/message_list.rs @@ -7,21 +7,37 @@ use google_gmail1::{ use crate::utils::Elide; -pub(crate) trait MessageList { - async fn log_message_subjects(&mut self) -> Result<()>; - async fn messages_list( +/// Methods to select lists of messages from the mailbox +pub trait MessageList { + /// Log the initial characters of the subjects of the message in the list + fn log_message_subjects(&mut self) -> impl std::future::Future> + Send; + /// List of messages + fn messages_list( &mut self, next_page_token: Option, - ) -> Result; - async fn run(&mut self, pages: u32) -> Result<()>; + ) -> impl std::future::Future> + Send; + /// Run something + fn run(&mut self, pages: u32) -> impl std::future::Future> + Send; + /// Return the gmail hub fn hub(&self) -> Gmail>; + /// Return the list of label_ids fn label_ids(&self) -> Vec; + /// Return the list of message ids fn message_ids(&self) -> Vec; + /// Return a summary of the messages (id and summary) fn messages(&self) -> &Vec; + /// Set the query for the message list fn set_query(&mut self, query: &str); + /// Add label ids to the list of labels for the message list fn add_labels_ids(&mut self, label_ids: &[String]); - async fn add_labels(&mut self, labels: &[String]) -> Result<()>; + /// Add labels to the list of labels for the message list + fn add_labels( + &mut self, + labels: &[String], + ) -> impl std::future::Future> + Send; + /// Report the max results value set fn max_results(&self) -> u32; + /// Set the max_results value fn set_max_results(&mut self, value: u32); }