pub struct JmapSession { /* private fields */ }Expand description
Owned JMAP session.
Implementations§
Source§impl JmapSession
impl JmapSession
Sourcepub fn default_account_id(&self) -> &str
pub fn default_account_id(&self) -> &str
Returns the active JMAP account identifier.
Sourcepub async fn session_info(&self) -> Result<JmapSessionInfo, Error>
pub async fn session_info(&self) -> Result<JmapSessionInfo, Error>
Returns current server session metadata.
Sourcepub async fn refresh(&self) -> Result<JmapSessionInfo, Error>
pub async fn refresh(&self) -> Result<JmapSessionInfo, Error>
Refreshes JMAP discovery metadata.
Sourcepub async fn list_mailboxes(&self) -> Result<Vec<JmapMailbox>, Error>
pub async fn list_mailboxes(&self) -> Result<Vec<JmapMailbox>, Error>
Lists all JMAP mailboxes sorted by name.
Sourcepub async fn get_mailbox(
&self,
id: impl Into<String>,
) -> Result<JmapMailbox, Error>
pub async fn get_mailbox( &self, id: impl Into<String>, ) -> Result<JmapMailbox, Error>
Returns a mailbox by JMAP identifier.
Sourcepub async fn create_mailbox(
&self,
name: impl Into<String>,
parent_id: Option<String>,
) -> Result<JmapMailbox, Error>
pub async fn create_mailbox( &self, name: impl Into<String>, parent_id: Option<String>, ) -> Result<JmapMailbox, Error>
Creates a mailbox, optionally beneath a parent mailbox.
Sourcepub async fn rename_mailbox(
&self,
id: impl Into<String>,
name: impl Into<String>,
) -> Result<Option<JmapMailbox>, Error>
pub async fn rename_mailbox( &self, id: impl Into<String>, name: impl Into<String>, ) -> Result<Option<JmapMailbox>, Error>
Renames a mailbox and returns the updated representation when supplied by the server.
Sourcepub async fn delete_mailbox(
&self,
id: impl Into<String>,
delete_emails: bool,
) -> Result<(), Error>
pub async fn delete_mailbox( &self, id: impl Into<String>, delete_emails: bool, ) -> Result<(), Error>
Deletes a mailbox, optionally deleting messages that would become mailbox-less.
Sourcepub async fn get_email(&self, id: impl Into<String>) -> Result<JmapEmail, Error>
pub async fn get_email(&self, id: impl Into<String>) -> Result<JmapEmail, Error>
Fetches an email by JMAP identifier.
Sourcepub async fn query_emails(
&self,
query: JmapEmailQuery,
) -> Result<JmapQueryResult, Error>
pub async fn query_emails( &self, query: JmapEmailQuery, ) -> Result<JmapQueryResult, Error>
Queries email identifiers using typed filters.
Sourcepub async fn set_email_keyword(
&self,
id: impl Into<String>,
keyword: impl Into<String>,
enabled: bool,
) -> Result<Option<JmapEmail>, Error>
pub async fn set_email_keyword( &self, id: impl Into<String>, keyword: impl Into<String>, enabled: bool, ) -> Result<Option<JmapEmail>, Error>
Adds or removes a JMAP keyword on an email.
Sourcepub async fn set_email_mailboxes(
&self,
id: impl Into<String>,
mailbox_ids: impl IntoIterator<Item = String>,
) -> Result<Option<JmapEmail>, Error>
pub async fn set_email_mailboxes( &self, id: impl Into<String>, mailbox_ids: impl IntoIterator<Item = String>, ) -> Result<Option<JmapEmail>, Error>
Replaces the mailbox membership of an email.
Trait Implementations§
Source§impl Debug for JmapSession
impl Debug for JmapSession
Source§impl Drop for JmapSession
impl Drop for JmapSession
Auto Trait Implementations§
impl Freeze for JmapSession
impl RefUnwindSafe for JmapSession
impl Send for JmapSession
impl Sync for JmapSession
impl Unpin for JmapSession
impl UnsafeUnpin for JmapSession
impl UnwindSafe for JmapSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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