pub struct Remote {
pub spec: String,
pub account: Account,
pub mailbox: String,
pub cache: PathBuf,
pub pending_backfill: Vec<u32>,
/* private fields */
}Fields§
§spec: Stringimap:account/mailbox, for the status line and folder browser.
account: Account§mailbox: String§cache: PathBuf§pending_backfill: Vec<u32>Older UIDs a huge folder left unfetched at open; the caller
hands them to backfill for a background mirror.
Implementations§
Source§impl Remote
impl Remote
Sourcepub fn open(
account: &Account,
mailbox: &str,
password: &str,
progress: Progress,
) -> Result<Remote>
pub fn open( account: &Account, mailbox: &str, password: &str, progress: Progress, ) -> Result<Remote>
Connect, log in, select, and bring the cache maildir up to date.
Sourcepub fn cutoff(&self) -> Cutoff
pub fn cutoff(&self) -> Cutoff
Reuse this session for another folder of the same account: a SELECT on the live connection instead of a fresh connect+login round. On failure the caller falls back to a full open. A handle on this connection’s socket, for cutting whatever it is doing short from another thread.
Sourcepub fn set_progress(&mut self, progress: Progress)
pub fn set_progress(&mut self, progress: Progress)
Point the progress lines somewhere else (the worker thread writes them where the session can pick them up).
pub fn switch(&mut self, mailbox: &str) -> Result<()>
Sourcepub fn refresh(&mut self) -> Result<usize>
pub fn refresh(&mut self) -> Result<usize>
Reconcile the cache with the server: pull flag changes, drop expunged messages, download headers of new ones. Returns how many new messages arrived.
Sourcepub fn search_body(&mut self, term: &str) -> Result<Vec<u32>>
pub fn search_body(&mut self, term: &str) -> Result<Vec<u32>>
Server-side ~b: UIDs of messages whose body contains term.
Sourcepub fn fetch_body(&mut self, path: &Path) -> Result<()>
pub fn fetch_body(&mut self, path: &Path) -> Result<()>
Replace a header-only cache file with the full message.
Sourcepub fn push_flags(&mut self, path: &Path, flags: Flags) -> Result<()>
pub fn push_flags(&mut self, path: &Path, flags: Flags) -> Result<()>
Push a local flag change (from $ sync) to the server.
Sourcepub fn copy_to_folder(&mut self, paths: &[PathBuf], mailbox: &str) -> Result<()>
pub fn copy_to_folder(&mut self, paths: &[PathBuf], mailbox: &str) -> Result<()>
UID COPY the cached messages into another folder of this account (the $trash step before a purge).
Sourcepub fn delete(&mut self, paths: &[PathBuf]) -> Result<()>
pub fn delete(&mut self, paths: &[PathBuf]) -> Result<()>
Mark the given cached messages \Deleted and expunge them.
Sourcepub fn create_folder(&mut self, name: &str) -> Result<()>
pub fn create_folder(&mut self, name: &str) -> Result<()>
mutt’s folder management, each a single command; the folder
name is taken as given (an imap:account/folder spec has had
its account stripped by the caller). RENAME’s and DELETE’s
effects are the server’s business.
pub fn delete_folder(&mut self, name: &str) -> Result<()>
pub fn rename_folder(&mut self, from: &str, to: &str) -> Result<()>
pub fn subscribe_folder(&mut self, name: &str, on: bool) -> Result<()>
Sourcepub fn folders(&mut self) -> Result<Vec<(String, usize)>>
pub fn folders(&mut self) -> Result<Vec<(String, usize)>>
Selectable folders with their UNSEEN counts, for the folder browser. The open folder’s count comes from the local cache (STATUS must not target the selected mailbox); a failing STATUS just shows as 0.
Sourcepub fn unseen(&mut self, mailbox: &str) -> usize
pub fn unseen(&mut self, mailbox: &str) -> usize
Unseen count of one folder of this account, for the sidebar: the open folder from its cache, others via STATUS (0 on error).
Sourcepub fn append_to(
&mut self,
mailbox: &str,
flags: Flags,
body: &[u8],
) -> Result<String>
pub fn append_to( &mut self, mailbox: &str, flags: Flags, body: &[u8], ) -> Result<String>
Fcc: file the sent message into the account’s Sent folder.
Returns the folder name for the status line.
APPEND a message into another folder of this account (s save).