pub struct ImapConfig {
pub host: String,
pub port: u16,
pub encryption: Option<Encryption>,
pub login: String,
pub auth: ImapAuthConfig,
pub extensions: Option<ImapExtensionsConfig>,
pub watch: Option<ImapWatchConfig>,
pub clients_pool_size: Option<u8>,
}Expand description
Errors related to the IMAP backend configuration. The IMAP backend configuration.
Fields§
§host: StringThe IMAP server host name.
port: u16The IMAP server host port.
encryption: Option<Encryption>The IMAP encryption protocol to use.
Supported encryption: SSL/TLS, STARTTLS or none.
login: StringThe IMAP server login.
Usually, the login is either the email address or its left part (before @).
auth: ImapAuthConfigThe IMAP server authentication configuration.
Authentication can be done using password or OAuth 2.0. See ImapAuthConfig.
extensions: Option<ImapExtensionsConfig>The IMAP extensions configuration.
watch: Option<ImapWatchConfig>The IMAP notify command.
Defines the command used to notify the user when a new email is available.
Defaults to notify-send "📫 <sender>" "<subject>".
clients_pool_size: Option<u8>The IMAP clients pool size.
Defines the number of clients that are created and managed simultaneously by the IMAP context. Defaults to 1.
Implementations§
Source§impl ImapConfig
impl ImapConfig
pub fn clients_pool_size(&self) -> u8
pub fn send_id_after_auth(&self) -> bool
Sourcepub fn is_encryption_enabled(&self) -> bool
pub fn is_encryption_enabled(&self) -> bool
Return true if TLS or StartTLS is enabled.
Sourcepub fn is_start_tls_encryption_enabled(&self) -> bool
pub fn is_start_tls_encryption_enabled(&self) -> bool
Return true if StartTLS is enabled.
Sourcepub fn is_encryption_disabled(&self) -> bool
pub fn is_encryption_disabled(&self) -> bool
Return true if encryption is disabled.
Sourcepub async fn build_credentials(&self) -> Result<String>
pub async fn build_credentials(&self) -> Result<String>
Builds authentication credentials.
Authentication credentials can be either a password or an OAuth 2.0 access token.
Sourcepub fn find_watch_timeout(&self) -> Option<u64>
pub fn find_watch_timeout(&self) -> Option<u64>
Find the IMAP watch timeout.
Trait Implementations§
Source§impl Clone for ImapConfig
impl Clone for ImapConfig
Source§fn clone(&self) -> ImapConfig
fn clone(&self) -> ImapConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImapConfig
impl Debug for ImapConfig
Source§impl Default for ImapConfig
impl Default for ImapConfig
Source§fn default() -> ImapConfig
fn default() -> ImapConfig
Source§impl<'de> Deserialize<'de> for ImapConfig
impl<'de> Deserialize<'de> for ImapConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ImapConfig
impl PartialEq for ImapConfig
Source§impl Serialize for ImapConfig
impl Serialize for ImapConfig
Source§impl SyncHash for ImapConfig
Available on crate feature sync only.
impl SyncHash for ImapConfig
sync only.fn sync_hash(&self, state: &mut DefaultHasher)
impl Eq for ImapConfig
impl StructuralPartialEq for ImapConfig
Auto Trait Implementations§
impl Freeze for ImapConfig
impl !RefUnwindSafe for ImapConfig
impl Send for ImapConfig
impl Sync for ImapConfig
impl Unpin for ImapConfig
impl UnsafeUnpin for ImapConfig
impl !UnwindSafe for ImapConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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