pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn connect(host: &str, port: u16, tls: bool) -> Result<Client>
Sourcepub fn connect_with(
host: &str,
port: u16,
tls: bool,
cutoff: &Cutoff,
) -> Result<Client>
pub fn connect_with( host: &str, port: u16, tls: bool, cutoff: &Cutoff, ) -> Result<Client>
The same, with a way to cut the connection short from another thread (mutt’s Ctrl+G).
pub fn login(&mut self, user: &str, password: &str) -> Result<()>
Sourcepub fn authenticate(
&mut self,
mechanism: &str,
response_b64: &str,
) -> Result<()>
pub fn authenticate( &mut self, mechanism: &str, response_b64: &str, ) -> Result<()>
SASL AUTHENTICATE with one client response (the OAuth mechanisms): send it on the server’s first continuation; a second continuation carries an error blob, which an empty line converts into the tagged NO.
pub fn list(&mut self) -> Result<Vec<Folder>>
pub fn select(&mut self, mailbox: &str) -> Result<Select>
Sourcepub fn uid_fetch_flags(&mut self, set: &str) -> Result<Vec<Fetched>>
pub fn uid_fetch_flags(&mut self, set: &str) -> Result<Vec<Fetched>>
UID and flags of the messages in set (e.g. 1:*).
Sourcepub fn uid_fetch_headers(&mut self, set: &str) -> Result<Vec<Fetched>>
pub fn uid_fetch_headers(&mut self, set: &str) -> Result<Vec<Fetched>>
Flags, size, and the full header block, for indexing new mail.
Sourcepub fn uid_store_flags(&mut self, uid: u32, flags: Flags) -> Result<()>
pub fn uid_store_flags(&mut self, uid: u32, flags: Flags) -> Result<()>
Overwrite the message’s flags (deletion goes via uid_delete).
pub fn uid_delete(&mut self, set: &str) -> Result<()>
pub fn expunge(&mut self) -> Result<()>
Sourcepub fn create_mailbox(&mut self, mailbox: &str) -> Result<()>
pub fn create_mailbox(&mut self, mailbox: &str) -> Result<()>
Folder management: CREATE, DELETE, RENAME, SUBSCRIBE,
UNSUBSCRIBE, each a single tagged command. The server’s tagged
NO/BAD becomes an error through finish.
pub fn delete_mailbox(&mut self, mailbox: &str) -> Result<()>
pub fn rename_mailbox(&mut self, from: &str, to: &str) -> Result<()>
pub fn subscribe_mailbox(&mut self, mailbox: &str, on: bool) -> Result<()>
Sourcepub fn uid_copy(&mut self, set: &str, mailbox: &str) -> Result<()>
pub fn uid_copy(&mut self, set: &str, mailbox: &str) -> Result<()>
Server-side copy into another folder ($trash before a purge).
pub fn append(&mut self, mailbox: &str, flags: Flags, body: &[u8]) -> Result<()>
Sourcepub fn uid_search_body(&mut self, text: &str) -> Result<Vec<u32>>
pub fn uid_search_body(&mut self, text: &str) -> Result<Vec<u32>>
Server-side body search: UIDs whose text contains text
(ASCII only; anything else needs CHARSET negotiation, so the
caller falls back to matching locally).
Sourcepub fn noop_changes(&mut self) -> Result<Changes>
pub fn noop_changes(&mut self) -> Result<Changes>
NOOP, classifying the server’s untagged report: nothing, only new arrivals (EXISTS/RECENT), or anything else (flag changes, expunges, unknown lines) that needs a full reconciliation.
Sourcepub fn supports_idle(&mut self) -> Result<bool>
pub fn supports_idle(&mut self) -> Result<bool>
True when the server advertises IDLE (RFC 2177).
Sourcepub fn status_unseen(&mut self, mailbox: &str) -> Result<u32>
pub fn status_unseen(&mut self, mailbox: &str) -> Result<u32>
UNSEEN count of a mailbox (STATUS must not target the currently selected one).
Sourcepub fn idle(&mut self, stop: &AtomicBool) -> Result<bool>
pub fn idle(&mut self, stop: &AtomicBool) -> Result<bool>
RFC 2177 IDLE: block until the server announces a change, stop
is set (checked whenever the socket’s read timeout fires), or
~25 minutes pass; re-issue before the server’s half-hour
limit. True = the mailbox changed.