pub struct AccountConfig {
pub host: String,
pub port: u16,
pub username: String,
pub password: Option<Secret>,
pub tls: bool,
pub trash_mailbox: Option<String>,
pub drafts_mailbox: Option<String>,
pub max_connections: Option<usize>,
}Expand description
Configuration for a single IMAP account.
Fields§
§host: String§port: u16§username: String§password: Option<Secret>Password secret: password.raw = "...", password.cmd = "...",
or password.keyring = "...". Legacy password = "..." is also accepted.
tls: bool§trash_mailbox: Option<String>Trash mailbox name override (default: auto-detect or “Trash”).
drafts_mailbox: Option<String>Drafts mailbox name override (default: auto-detect or “Drafts”).
max_connections: Option<usize>Max concurrent IMAP connections for this account (default: 3).
Implementations§
Source§impl AccountConfig
impl AccountConfig
Sourcepub fn new(host: impl Into<String>, username: impl Into<String>) -> Self
pub fn new(host: impl Into<String>, username: impl Into<String>) -> Self
Create an account config programmatically (for in-process use). Password is resolved via keyring using the username.
Sourcepub fn with_trash(self, mailbox: impl Into<String>) -> Self
pub fn with_trash(self, mailbox: impl Into<String>) -> Self
Set trash mailbox name.
Sourcepub fn with_drafts(self, mailbox: impl Into<String>) -> Self
pub fn with_drafts(self, mailbox: impl Into<String>) -> Self
Set drafts mailbox name.
Sourcepub fn with_max_connections(self, n: usize) -> Self
pub fn with_max_connections(self, n: usize) -> Self
Set max concurrent IMAP connections.
Trait Implementations§
Source§impl Clone for AccountConfig
impl Clone for AccountConfig
Source§fn clone(&self) -> AccountConfig
fn clone(&self) -> AccountConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AccountConfig
impl Debug for AccountConfig
Source§impl<'de> Deserialize<'de> for AccountConfig
impl<'de> Deserialize<'de> for AccountConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AccountConfig
impl !RefUnwindSafe for AccountConfig
impl Send for AccountConfig
impl Sync for AccountConfig
impl Unpin for AccountConfig
impl UnsafeUnpin for AccountConfig
impl !UnwindSafe for AccountConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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