♻️ refactor(message): rename message to message_list

- rename `message.rs` to `message_list.rs` to improve clarity
- update struct name from `Message` to `MessageList`
This commit is contained in:
Jeremiah Russell
2025-10-05 09:44:19 +01:00
committed by Jeremiah Russell
parent 36d92b4126
commit 188a311175

View File

@@ -15,14 +15,14 @@ use crate::{Credential, Error};
pub const DEFAULT_MAX_RESULTS: &str = "10";
/// Struct to capture configuration for List API call.
pub struct Message {
pub struct MessageList {
hub: Gmail<HttpsConnector<HttpConnector>>,
max_results: u32,
label_ids: Vec<String>,
query: String,
}
impl Message {
impl MessageList {
/// Create a new List struct and add the Gmail api connection.
pub async fn new(credential: &str) -> Result<Self, Error> {
let (config_dir, secret) = {
@@ -52,7 +52,7 @@ impl Message {
.await
.unwrap();
Ok(Message {
Ok(MessageList {
hub: Gmail::new(client, auth),
max_results: DEFAULT_MAX_RESULTS.parse::<u32>().unwrap(),
label_ids: Vec::new(),