Struct email::backend::ImapConfig
source · pub struct ImapConfig {
pub host: String,
pub port: u16,
pub ssl: Option<bool>,
pub starttls: Option<bool>,
pub insecure: Option<bool>,
pub login: String,
pub auth: ImapAuthConfig,
pub notify_cmd: Option<String>,
pub notify_query: Option<String>,
pub watch_cmds: Option<Vec<String>>,
}
Expand description
The IMAP backend configuration.
Fields§
§host: String
The IMAP server host name.
port: u16
The IMAP server host port.
ssl: Option<bool>
Enables TLS/SSL.
Defaults to true
.
starttls: Option<bool>
Enables StartTLS.
Defaults to false
.
insecure: Option<bool>
Trusts any certificate.
Defaults to false
.
login: String
The IMAP server login.
Usually, the login is either the email address or its left part (before @).
auth: ImapAuthConfig
The IMAP server authentication configuration.
Authentication can be done using password or OAuth 2.0. See ImapAuthConfig.
notify_cmd: Option<String>
The IMAP notify command.
Defines the command used to notify the user when a new email is available.
Defaults to notify-send "📫 <sender>" "<subject>"
.
notify_query: Option<String>
The IMAP notify query.
Defines the IMAP query used to determine the new emails list.
Defaults to NEW
.
watch_cmds: Option<Vec<String>>
The watch commands.
Defines the commands to run whenever a change occurs on the IMAP server.
Implementations§
source§impl ImapConfig
impl ImapConfig
sourcepub fn notify_query(&self) -> String
pub fn notify_query(&self) -> String
Notify query option getter.
sourcepub fn watch_cmds(&self) -> Vec<String>
pub fn watch_cmds(&self) -> Vec<String>
Watch commands option getter.
sourcepub async fn run_notify_cmd(
&self,
id: u32,
subject: impl AsRef<str>,
sender: impl AsRef<str>
) -> Result<()>
pub async fn run_notify_cmd( &self, id: u32, subject: impl AsRef<str>, sender: impl AsRef<str> ) -> Result<()>
Runs the IMAP notify command.
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.
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 PartialEq<ImapConfig> for ImapConfig
impl PartialEq<ImapConfig> for ImapConfig
source§fn eq(&self, other: &ImapConfig) -> bool
fn eq(&self, other: &ImapConfig) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for ImapConfig
impl StructuralEq for ImapConfig
impl StructuralPartialEq for ImapConfig
Auto Trait Implementations§
impl RefUnwindSafe for ImapConfig
impl Send for ImapConfig
impl Sync for ImapConfig
impl Unpin for ImapConfig
impl UnwindSafe for ImapConfig
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst, DefaultApprox>,
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq<T>,
fn contains(&self, val: &T) -> boolwhere T: PartialEq<T>,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where 'p: 'b,
MaybeRef
].