Skip to main content

Remote

Struct Remote 

Source
pub struct Remote {
    pub spec: String,
    pub account: Account,
    pub mailbox: String,
    pub cache: PathBuf,
    pub pending_backfill: Vec<u32>,
    /* private fields */
}

Fields§

§spec: String

imap: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

Source

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.

Source

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.

Source

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).

Source

pub fn switch(&mut self, mailbox: &str) -> Result<()>

Source

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.

Source

pub fn search_body(&mut self, term: &str) -> Result<Vec<u32>>

Server-side ~b: UIDs of messages whose body contains term.

Source

pub fn fetch_body(&mut self, path: &Path) -> Result<()>

Replace a header-only cache file with the full message.

Source

pub fn push_flags(&mut self, path: &Path, flags: Flags) -> Result<()>

Push a local flag change (from $ sync) to the server.

Source

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).

Source

pub fn delete(&mut self, paths: &[PathBuf]) -> Result<()>

Mark the given cached messages \Deleted and expunge them.

Source

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.

Source

pub fn delete_folder(&mut self, name: &str) -> Result<()>

Source

pub fn rename_folder(&mut self, from: &str, to: &str) -> Result<()>

Source

pub fn subscribe_folder(&mut self, name: &str, on: bool) -> Result<()>

Source

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.

Source

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).

Source

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).

Source

pub fn append_sent(&mut self, body: &[u8]) -> Result<String>

Source

pub fn check_new(&mut self) -> Result<usize>

Poll the server. Arrivals alone are fetched incrementally from the last known UID; anything else triggers a full reconcile.

Trait Implementations§

Source§

impl Drop for Remote

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Remote

§

impl !Sync for Remote

§

impl !UnwindSafe for Remote

§

impl Freeze for Remote

§

impl Send for Remote

§

impl Unpin for Remote

§

impl UnsafeUnpin for Remote

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.