pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
pub async fn get_body( &self, message_id: &MessageId, ) -> Result<Option<MessageBody>, Error>
pub async fn insert_body(&self, body: &MessageBody) -> Result<(), Error>
Source§impl Store
impl Store
pub async fn insert_draft(&self, draft: &Draft) -> Result<(), Error>
pub async fn get_draft(&self, id: &DraftId) -> Result<Option<Draft>, Error>
pub async fn list_drafts( &self, account_id: &AccountId, ) -> Result<Vec<Draft>, Error>
pub async fn delete_draft(&self, id: &DraftId) -> Result<(), Error>
Source§impl Store
impl Store
pub async fn insert_event_refs( &self, level: &str, category: &str, summary: &str, account_id: Option<&AccountId>, message_id: Option<&str>, rule_id: Option<&str>, details: Option<&str>, ) -> Result<(), Error>
pub async fn insert_event( &self, level: &str, category: &str, summary: &str, account_id: Option<&AccountId>, details: Option<&str>, ) -> Result<(), Error>
pub async fn list_events( &self, limit: u32, level: Option<&str>, category: Option<&str>, ) -> Result<Vec<EventLogEntry>, Error>
pub async fn prune_events_before( &self, cutoff_timestamp: i64, ) -> Result<u64, Error>
Source§impl Store
impl Store
pub async fn upsert_label(&self, label: &Label) -> Result<(), Error>
pub async fn list_labels_by_account( &self, account_id: &AccountId, ) -> Result<Vec<Label>, Error>
pub async fn update_label_counts( &self, label_id: &LabelId, unread_count: u32, total_count: u32, ) -> Result<(), Error>
pub async fn delete_label(&self, label_id: &LabelId) -> Result<(), Error>
pub async fn replace_label( &self, old_label_id: &LabelId, new_label: &Label, ) -> Result<(), Error>
pub async fn recalculate_label_counts( &self, account_id: &AccountId, ) -> Result<(), Error>
Sourcepub async fn find_labels_by_provider_ids(
&self,
account_id: &AccountId,
provider_ids: &[String],
) -> Result<Vec<LabelId>, Error>
pub async fn find_labels_by_provider_ids( &self, account_id: &AccountId, provider_ids: &[String], ) -> Result<Vec<LabelId>, Error>
Look up LabelIds from a list of provider_ids (e.g. [“INBOX”, “SENT”]). Returns only the IDs for labels that exist in the store.
pub async fn find_label_by_provider_id( &self, account_id: &AccountId, provider_id: &str, ) -> Result<Option<Label>, Error>
Source§impl Store
impl Store
pub async fn upsert_envelope(&self, envelope: &Envelope) -> Result<(), Error>
pub async fn get_envelope( &self, id: &MessageId, ) -> Result<Option<Envelope>, Error>
pub async fn list_envelopes_by_label( &self, label_id: &LabelId, limit: u32, offset: u32, ) -> Result<Vec<Envelope>, Error>
pub async fn list_envelopes_by_account( &self, account_id: &AccountId, limit: u32, offset: u32, ) -> Result<Vec<Envelope>, Error>
pub async fn list_envelopes_by_ids( &self, message_ids: &[MessageId], ) -> Result<Vec<Envelope>, Error>
pub async fn delete_messages_by_provider_ids( &self, account_id: &AccountId, provider_ids: &[String], ) -> Result<u64, Error>
pub async fn set_message_labels( &self, message_id: &MessageId, label_ids: &[LabelId], ) -> Result<(), Error>
pub async fn update_message_thread_id( &self, message_id: &MessageId, thread_id: &ThreadId, ) -> Result<(), Error>
pub async fn get_message_id_by_provider_id( &self, account_id: &AccountId, provider_id: &str, ) -> Result<Option<MessageId>, Error>
pub async fn count_messages_by_account( &self, account_id: &AccountId, ) -> Result<u32, Error>
Sourcepub async fn list_all_envelopes_paginated(
&self,
limit: u32,
offset: u32,
) -> Result<Vec<Envelope>, Error>
pub async fn list_all_envelopes_paginated( &self, limit: u32, offset: u32, ) -> Result<Vec<Envelope>, Error>
List all envelopes across all accounts, paginated. Used for reindexing.
Sourcepub async fn count_all_messages(&self) -> Result<u32, Error>
pub async fn count_all_messages(&self) -> Result<u32, Error>
Count all messages across all accounts. Used for reindexing.
pub async fn update_flags( &self, message_id: &MessageId, flags: MessageFlags, ) -> Result<(), Error>
Sourcepub async fn set_read(
&self,
message_id: &MessageId,
read: bool,
) -> Result<(), Error>
pub async fn set_read( &self, message_id: &MessageId, read: bool, ) -> Result<(), Error>
Set the read flag on a message.
Sourcepub async fn set_starred(
&self,
message_id: &MessageId,
starred: bool,
) -> Result<(), Error>
pub async fn set_starred( &self, message_id: &MessageId, starred: bool, ) -> Result<(), Error>
Set the starred flag on a message.
Sourcepub async fn get_provider_id(
&self,
message_id: &MessageId,
) -> Result<Option<String>, Error>
pub async fn get_provider_id( &self, message_id: &MessageId, ) -> Result<Option<String>, Error>
Get the provider_id for a message.
Sourcepub async fn get_message_label_ids(
&self,
message_id: &MessageId,
) -> Result<Vec<LabelId>, Error>
pub async fn get_message_label_ids( &self, message_id: &MessageId, ) -> Result<Vec<LabelId>, Error>
Get the label IDs for a message.
Sourcepub async fn add_message_label(
&self,
message_id: &MessageId,
label_id: &LabelId,
) -> Result<(), Error>
pub async fn add_message_label( &self, message_id: &MessageId, label_id: &LabelId, ) -> Result<(), Error>
Add a label to a message.
Sourcepub async fn remove_message_label(
&self,
message_id: &MessageId,
label_id: &LabelId,
) -> Result<(), Error>
pub async fn remove_message_label( &self, message_id: &MessageId, label_id: &LabelId, ) -> Result<(), Error>
Remove a label from a message.
Sourcepub async fn count_message_labels(&self) -> Result<u32, Error>
pub async fn count_message_labels(&self) -> Result<u32, Error>
Count total rows in the message_labels junction table.
Sourcepub async fn move_to_trash(&self, message_id: &MessageId) -> Result<(), Error>
pub async fn move_to_trash(&self, message_id: &MessageId) -> Result<(), Error>
Mark a message as trashed (update flags).
Sourcepub async fn list_contacts(
&self,
limit: u32,
) -> Result<Vec<(String, String)>, Error>
pub async fn list_contacts( &self, limit: u32, ) -> Result<Vec<(String, String)>, Error>
Get distinct contacts (name + email) from message senders, ordered by frequency.
pub async fn list_subscriptions( &self, limit: u32, ) -> Result<Vec<SubscriptionSummary>, Error>
Source§impl Store
impl Store
pub async fn upsert_rule(&self, rule: RuleRecordInput<'_>) -> Result<(), Error>
pub async fn list_rules(&self) -> Result<Vec<SqliteRow>, Error>
pub async fn get_rule_by_id_or_name( &self, key: &str, ) -> Result<Option<SqliteRow>, Error>
pub async fn delete_rule(&self, id: &str) -> Result<(), Error>
pub async fn insert_rule_log(&self, log: RuleLogInput<'_>) -> Result<(), Error>
pub async fn list_rule_logs( &self, rule_id: Option<&str>, limit: u32, ) -> Result<Vec<SqliteRow>, Error>
Source§impl Store
impl Store
pub async fn insert_saved_search( &self, search: &SavedSearch, ) -> Result<(), Error>
pub async fn list_saved_searches(&self) -> Result<Vec<SavedSearch>, Error>
pub async fn delete_saved_search(&self, id: &SavedSearchId) -> Result<(), Error>
pub async fn get_saved_search_by_name( &self, name: &str, ) -> Result<Option<SavedSearch>, Error>
pub async fn delete_saved_search_by_name( &self, name: &str, ) -> Result<bool, Error>
Source§impl Store
impl Store
pub async fn insert_snooze(&self, snoozed: &Snoozed) -> Result<(), Error>
pub async fn get_due_snoozes( &self, now: DateTime<Utc>, ) -> Result<Vec<Snoozed>, Error>
pub async fn list_snoozed(&self) -> Result<Vec<Snoozed>, Error>
pub async fn get_snooze( &self, message_id: &MessageId, ) -> Result<Option<Snoozed>, Error>
pub async fn remove_snooze(&self, message_id: &MessageId) -> Result<(), Error>
Source§impl Store
impl Store
pub async fn get_sync_cursor( &self, account_id: &AccountId, ) -> Result<Option<SyncCursor>, Error>
pub async fn set_sync_cursor( &self, account_id: &AccountId, cursor: &SyncCursor, ) -> Result<(), Error>
Source§impl Store
impl Store
pub async fn insert_sync_log( &self, account_id: &AccountId, status: &SyncStatus, ) -> Result<i64, Error>
pub async fn complete_sync_log( &self, log_id: i64, status: &SyncStatus, messages_synced: u32, error_message: Option<&str>, ) -> Result<(), Error>
pub async fn get_last_sync( &self, account_id: &AccountId, ) -> Result<Option<SyncLogEntry>, Error>
Source§impl Store
impl Store
pub async fn upsert_sync_runtime_status( &self, account_id: &AccountId, update: &SyncRuntimeStatusUpdate, ) -> Result<(), Error>
pub async fn get_sync_runtime_status( &self, account_id: &AccountId, ) -> Result<Option<SyncRuntimeStatus>, Error>
pub async fn list_sync_runtime_statuses( &self, ) -> Result<Vec<SyncRuntimeStatus>, Error>
Auto Trait Implementations§
impl Freeze for Store
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl !UnwindSafe for Store
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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