GmailClient

Struct GmailClient 

Source
pub struct GmailClient { /* private fields */ }
Expand description

Struct to capture configuration for List API call.

Implementations§

Source§

impl GmailClient

Source

pub async fn new(credential: &str) -> Result<Self>

Create a new List struct and add the Gmail api connection.

Source

pub fn get_label_id(&self, name: &str) -> Option<String>

Return the id for the name from the labels map. Returns None if the name is not found in the map.

Source

pub fn show_label(&self)

Show the label names and related id.

Trait Implementations§

Source§

impl Clone for GmailClient

Source§

fn clone(&self) -> GmailClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GmailClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MessageList for GmailClient

Source§

fn set_max_results(&mut self, value: u32)

Set the maximum results

Source§

fn max_results(&self) -> u32

Report the maximum results value

Source§

fn add_labels(&mut self, labels: &[String]) -> Result<()>

Add label to the labels collection

Source§

fn add_labels_ids(&mut self, label_ids: &[String])

Add label to the labels collection

Source§

fn set_query(&mut self, query: &str)

Set the query string

Source§

fn messages(&self) -> &Vec<MessageSummary>

Get the summary of the messages

Source§

fn message_ids(&self) -> Vec<String>

Get a reference to the message_ids

Source§

fn label_ids(&self) -> Vec<String>

Get a reference to the message_ids

Source§

fn hub(&self) -> Gmail<HttpsConnector<HttpConnector>>

Get the hub

Source§

async fn get_messages(&mut self, pages: u32) -> Result<()>

Run the Gmail api as configured

Source§

async fn messages_list( &mut self, next_page_token: Option<String>, ) -> Result<ListMessagesResponse>

List of messages
Source§

async fn log_messages(&mut self) -> Result<()>

Log the initial characters of the subjects of the message in the list
Source§

impl RuleProcessor for GmailClient

Source§

fn set_rule(&mut self, value: EolRule)

Add Action to the Client for processing

Source§

fn set_execute(&mut self, value: bool)

Set the execute flag

Source§

fn action(&self) -> Option<EolAction>

The action set in the rule

Source§

async fn find_rule_and_messages_for_label(&mut self, label: &str) -> Result<()>

Find the rule and messages for the label

Source§

async fn prepare(&mut self, pages: u32) -> Result<()>

Prepare the message list for delete to be completed on execute by batch_delete

Source§

async fn batch_delete(&self) -> Result<()>

Run the batch delete on the selected messages

Source§

async fn batch_trash(&self) -> Result<()>

Move the messages to trash

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,