pub struct Maildir {
root: PathBuf,
cur: PathBuf,
new: PathBuf,
tmp: PathBuf,
info_separator: &'static str,
}
Expand description
The mail directory.
A Maildir is a mail directory composed of a new
, cur
and tmp
subdirectories.
Fields§
§root: PathBuf
The root path of the mail directory.
cur: PathBuf
§new: PathBuf
§tmp: PathBuf
§info_separator: &'static str
The Maildir entry id ←→ info separator.
Implementations§
Source§impl Maildir
impl Maildir
pub fn set_info_separator(&mut self, sep: &'static str)
pub fn with_info_separator(self, sep: &'static str) -> Self
pub fn path(&self) -> &Path
pub fn name(&self) -> Result<&str>
pub fn cur(&self) -> &Path
pub fn new(&self) -> &Path
pub fn tmp(&self) -> &Path
pub fn exists(&self) -> bool
pub fn create(&self) -> Result<()>
pub fn create_all(&self) -> Result<()>
Sourcepub fn remove(&self) -> Result<()>
pub fn remove(&self) -> Result<()>
Removes the cur, new and tmp directories from the current Maildir.
This function does not remove the root directory. If you want
to do so, see Maildir::remove_all
.
Sourcepub fn remove_all(&self) -> Result<()>
pub fn remove_all(&self) -> Result<()>
Removes the current Maildir.
This function removes the cur, new and tmp directories as well
as the root directory of the current Maildir. See also
Maildir::remove
.
pub fn read(&self) -> Result<impl Iterator<Item = MaildirEntry> + '_>
pub fn find(&self, id: impl AsRef<str>) -> Result<Option<MaildirEntry>>
pub fn get(&self, id: impl AsRef<str>) -> Result<MaildirEntry>
pub fn write_new(&self, contents: impl AsRef<[u8]>) -> Result<MaildirEntry>
pub fn write_cur( &self, contents: impl AsRef<[u8]>, flags: impl IntoIterator<Item = Flag>, ) -> Result<MaildirEntry>
fn write( &self, contents: impl AsRef<[u8]>, flags: impl IntoIterator<Item = Flag>, new: bool, id: Option<String>, ) -> Result<MaildirEntry>
fn format_file_name(&self, id: String, flags: HashSet<Flag>) -> String
Trait Implementations§
impl Eq for Maildir
impl StructuralPartialEq for Maildir
Auto Trait Implementations§
impl Freeze for Maildir
impl RefUnwindSafe for Maildir
impl Send for Maildir
impl Sync for Maildir
impl Unpin for Maildir
impl UnwindSafe for Maildir
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