pub enum FolderKind {
Inbox,
Sent,
Drafts,
Trash,
UserDefined(String),
}
Expand description
The folder kind enumeration.
The folder kind is a category that gives a specific purpose to a folder. It is used internally by the library to operate on the right folder.
FolderConfig::aliases
allows users to map custom folder names but also to map the
following folder kinds.
Variants§
Inbox
The kind of folder that contains received emails.
This folder kind is mostly used for listing new or recent emails.
Sent
The kind of folder that contains sent emails.
This folder kind is used to store a copy of sent emails.
Drafts
The kind of folder than contains not finished emails.
This kind of folder is used to store drafts. Emails in this folder are supposed to be edited. Once completed they should be removed from the folder.
Trash
The kind of folder that contains trashed emails.
This kind of folder is used as a trash bin. Emails contained in this folder are supposed to be deleted.
UserDefined(String)
The user-defined kind of folder.
This kind of folder represents the alias as defined by the
user in config::FolderConfig
::aliases.
Implementations§
Source§impl FolderKind
impl FolderKind
Sourcepub fn is_inbox(&self) -> bool
pub fn is_inbox(&self) -> bool
Return true
if the current folder kind matches the Inbox
variant.
Sourcepub fn is_drafts(&self) -> bool
pub fn is_drafts(&self) -> bool
Return true
if the current folder kind matches the Drafts
variant.
Sourcepub fn is_trash(&self) -> bool
pub fn is_trash(&self) -> bool
Return true
if the current folder kind matches the Trash
variant.
Sourcepub fn is_user_defined(&self) -> bool
pub fn is_user_defined(&self) -> bool
Return true
if the current folder kind matches the
UserDefined variant.
Sourcepub fn matches_inbox(folder: impl AsRef<str>) -> bool
pub fn matches_inbox(folder: impl AsRef<str>) -> bool
Return true
if the give string matches the Inbox variant.
Sourcepub fn matches_sent(folder: impl AsRef<str>) -> bool
pub fn matches_sent(folder: impl AsRef<str>) -> bool
Return true
if the given string matches the Sent variant.
Sourcepub fn matches_drafts(folder: impl AsRef<str>) -> bool
pub fn matches_drafts(folder: impl AsRef<str>) -> bool
Return true
if the given string matches the Drafts variant.
Sourcepub fn matches_trash(folder: impl AsRef<str>) -> bool
pub fn matches_trash(folder: impl AsRef<str>) -> bool
Return true
if the given string matches the Trash variant.
Trait Implementations§
Source§impl Clone for FolderKind
impl Clone for FolderKind
Source§fn clone(&self) -> FolderKind
fn clone(&self) -> FolderKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FolderKind
impl Debug for FolderKind
Source§impl Display for FolderKind
impl Display for FolderKind
Source§impl FromStr for FolderKind
impl FromStr for FolderKind
Source§impl Hash for FolderKind
impl Hash for FolderKind
Source§impl PartialEq for FolderKind
impl PartialEq for FolderKind
impl Eq for FolderKind
impl StructuralPartialEq for FolderKind
Auto Trait Implementations§
impl Freeze for FolderKind
impl RefUnwindSafe for FolderKind
impl Send for FolderKind
impl Sync for FolderKind
impl Unpin for FolderKind
impl UnwindSafe for FolderKind
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<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