pub struct GmailProvider { /* private fields */ }Expand description
One Gmail mailbox with its primary Google calendar.
Implementations§
Source§impl GmailProvider
impl GmailProvider
pub fn new(auth: GoogleAuth) -> Self
Trait Implementations§
Source§impl Provider for GmailProvider
impl Provider for GmailProvider
Source§fn cancel_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
_message: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn cancel_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
_message: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Google has no cancellation message: attendees get Google’s own
cancellation notice and message is not sent.
fn kind(&self) -> ProviderKind
Source§fn sync_mail<'life0, 'life1, 'async_trait>(
&'life0 self,
since: DateTime<Utc>,
cursor: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = ProviderResult<MailSync>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sync_mail<'life0, 'life1, 'async_trait>(
&'life0 self,
since: DateTime<Utc>,
cursor: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = ProviderResult<MailSync>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sync the inbox, archive and sent mail received on or after
since.
cursor is None to bootstrap, which returns everything in the
window as upserts (paged with more).Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 SearchQuery,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<MailItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 SearchQuery,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<MailItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search the whole mailbox, newest first.
Source§fn get_items<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<MailItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_items<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<MailItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Metadata of a few messages (a refresh after a change).
fn get_message<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<FullMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<FullMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<FullMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The messages of a conversation, oldest first.
Source§fn message_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<(String, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn message_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<(String, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Every internet header of a message, in the order the service gives
them.
fn unsubscribe_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<UnsubscribeHeaders>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn apply<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
change: &'life2 MailChange,
) -> Pin<Box<dyn Future<Output = Vec<ProviderResult<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn apply<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
change: &'life2 MailChange,
) -> Pin<Box<dyn Future<Output = Vec<ProviderResult<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Apply one change to many messages; one result per id, in order.
fn list_folders<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<FolderInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn ensure_folder<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Folder>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ensure_folder<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Folder>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find or create a folder by
/-separated path; returns it.Source§fn list_categories<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_categories<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The mailbox’s category (label) names.
Source§fn ensure_category<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ensure_category<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Make sure a category exists (idempotent).
fn list_attachments<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<Attachment>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn attachment_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
attachment_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 DraftSpec,
) -> Pin<Box<dyn Future<Output = ProviderResult<Draft>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_draft<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
spec: &'life2 DraftSpec,
) -> Pin<Box<dyn Future<Output = ProviderResult<Draft>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Draft>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn list_events<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<Event>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_events<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<Event>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Events overlapping
[from, to), recurring events expanded.fn get_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<Event>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn create_event<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 EventSpec,
) -> Pin<Box<dyn Future<Output = ProviderResult<Event>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_event<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 EventSpec,
) -> Pin<Box<dyn Future<Output = ProviderResult<Event>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create; invitations go out to attendees at once.
fn update_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
patch: &'life2 EventPatch,
) -> Pin<Box<dyn Future<Output = ProviderResult<Event>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn delete_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an event from the user’s calendar without notifying anyone.
fn respond<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
response: Rsvp,
message: Option<&'life2 str>,
notify: bool,
) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn free_busy<'life0, 'life1, 'async_trait>(
&'life0 self,
people: &'life1 [String],
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<(String, Vec<BusyBlock>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn free_busy<'life0, 'life1, 'async_trait>(
&'life0 self,
people: &'life1 [String],
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = ProviderResult<Vec<(String, Vec<BusyBlock>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Busy blocks for other people.
Unsupported where the account type
cannot see others’ calendars.Source§fn find_by_message_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_message_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<MailItem>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn find_by_message_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_message_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<MailItem>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
The messages with this internet Message-ID (the received copy and the
sent one can both have it), when the provider’s ids can go stale and
it can look them up.
Source§fn people<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersonHint>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn people<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersonHint>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
People the user corresponds with, best first. Empty when the
provider has no such API (the engine also learns from the index).
Auto Trait Implementations§
impl !Freeze for GmailProvider
impl !RefUnwindSafe for GmailProvider
impl !UnwindSafe for GmailProvider
impl Forget for GmailProvider
impl Move for GmailProvider
impl Send for GmailProvider
impl Sync for GmailProvider
impl Unpin for GmailProvider
impl UnsafeUnpin for GmailProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more