♻️ refactor(gmail): improve gmail client structure
- add clone derive to GmailClient struct - rename get_messages to get_message_list for clarity
This commit is contained in:
committed by
Jeremiah Russell
parent
e5b93c0bdd
commit
0dc8f8c47b
@@ -16,6 +16,7 @@ use crate::{Credential, Error, MessageList, Result};
|
|||||||
pub const DEFAULT_MAX_RESULTS: &str = "200";
|
pub const DEFAULT_MAX_RESULTS: &str = "200";
|
||||||
|
|
||||||
/// Struct to capture configuration for List API call.
|
/// Struct to capture configuration for List API call.
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct GmailClient {
|
pub struct GmailClient {
|
||||||
hub: Gmail<HttpsConnector<HttpConnector>>,
|
hub: Gmail<HttpsConnector<HttpConnector>>,
|
||||||
label_map: BTreeMap<String, String>,
|
label_map: BTreeMap<String, String>,
|
||||||
@@ -110,7 +111,8 @@ impl GmailClient {
|
|||||||
self.hub.clone()
|
self.hub.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_messages(&self) -> Result<MessageList> {
|
/// Get the message list
|
||||||
MessageList::new(&self).await
|
pub async fn get_message_list(&self) -> Result<MessageList> {
|
||||||
|
MessageList::new(self).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user