Struct imap::client::Client
[−]
[src]
pub struct Client<T> { pub debug: bool, // some fields omitted }
Stream to interface with the IMAP server. This interface is only for the command stream.
Fields
debug: bool
Methods
impl Client<TcpStream>
[src]
fn connect<A: ToSocketAddrs>(addr: A) -> Result<Client<TcpStream>>
Creates a new client.
fn secure(self, ssl_context: SslContext) -> Result<Client<SslStream<TcpStream>>>
This will upgrade a regular TCP connection to use SSL.
impl Client<SslStream<TcpStream>>
[src]
fn secure_connect<A: ToSocketAddrs>(addr: A,
ssl_context: SslContext)
-> Result<Client<SslStream<TcpStream>>>
ssl_context: SslContext)
-> Result<Client<SslStream<TcpStream>>>
Creates a client with an SSL wrapper.
impl<T: Read + Write> Client<T>
[src]
fn new(stream: T) -> Client<T>
Creates a new client with the underlying stream.
fn authenticate<A: Authenticator>(&mut self,
auth_type: &str,
authenticator: A)
-> Result<()>
auth_type: &str,
authenticator: A)
-> Result<()>
Authenticate will authenticate with the server, using the authenticator given.
fn login(&mut self, username: &str, password: &str) -> Result<()>
Log in to the IMAP server.
fn select(&mut self, mailbox_name: &str) -> Result<Mailbox>
Selects a mailbox
fn examine(&mut self, mailbox_name: &str) -> Result<Mailbox>
Examine is identical to Select, but the selected mailbox is identified as read-only
fn fetch(&mut self, sequence_set: &str, query: &str) -> Result<Vec<String>>
Fetch retreives data associated with a message in the mailbox.
fn uid_fetch(&mut self, uid_set: &str, query: &str) -> Result<Vec<String>>
fn noop(&mut self) -> Result<()>
Noop always succeeds, and it does nothing.
fn logout(&mut self) -> Result<()>
Logout informs the server that the client is done with the connection.
fn create(&mut self, mailbox_name: &str) -> Result<()>
Create creates a mailbox with the given name.
fn delete(&mut self, mailbox_name: &str) -> Result<()>
Delete permanently removes the mailbox with the given name.
fn rename(&mut self,
current_mailbox_name: &str,
new_mailbox_name: &str)
-> Result<()>
current_mailbox_name: &str,
new_mailbox_name: &str)
-> Result<()>
Rename changes the name of a mailbox.
fn subscribe(&mut self, mailbox: &str) -> Result<()>
Subscribe adds the specified mailbox name to the server's set of "active" or "subscribed" mailboxes as returned by the LSUB command.
fn unsubscribe(&mut self, mailbox: &str) -> Result<()>
Unsubscribe removes the specified mailbox name from the server's set of "active" or "subscribed" mailboxes as returned by the LSUB command.
fn capability(&mut self) -> Result<Vec<String>>
Capability requests a listing of capabilities that the server supports.
fn expunge(&mut self) -> Result<()>
Expunge permanently removes all messages that have the \Deleted flag set from the currently selected mailbox.
fn check(&mut self) -> Result<()>
Check requests a checkpoint of the currently selected mailbox.
fn close(&mut self) -> Result<()>
Close permanently removes all messages that have the \Deleted flag set from the currently selected mailbox, and returns to the authenticated state from the selected state.
fn store(&mut self, sequence_set: &str, query: &str) -> Result<Vec<String>>
Store alters data associated with a message in the mailbox.
fn uid_store(&mut self, uid_set: &str, query: &str) -> Result<Vec<String>>
fn copy(&mut self, sequence_set: &str, mailbox_name: &str) -> Result<()>
Copy copies the specified message to the end of the specified destination mailbox.
fn uid_copy(&mut self, uid_set: &str, mailbox_name: &str) -> Result<()>
fn list(&mut self,
reference_name: &str,
mailbox_search_pattern: &str)
-> Result<Vec<String>>
reference_name: &str,
mailbox_search_pattern: &str)
-> Result<Vec<String>>
The LIST command returns a subset of names from the complete set of all names available to the client.
fn lsub(&mut self,
reference_name: &str,
mailbox_search_pattern: &str)
-> Result<Vec<String>>
reference_name: &str,
mailbox_search_pattern: &str)
-> Result<Vec<String>>
The LSUB command returns a subset of names from the set of names that the user has declared as being "active" or "subscribed".
fn status(&mut self,
mailbox_name: &str,
status_data_items: &str)
-> Result<Vec<String>>
mailbox_name: &str,
status_data_items: &str)
-> Result<Vec<String>>
The STATUS command requests the status of the indicated mailbox.
fn idle(&mut self) -> Result<IdleHandle<T>>
Returns a handle that can be used to block until the state of the currently selected mailbox changes.
fn run_command_and_check_ok(&mut self, command: &str) -> Result<()>
Runs a command and checks if it returns OK.
fn run_command_and_parse(&mut self, command: &str) -> Result<Vec<String>>
fn run_command(&mut self, untagged_command: &str) -> Result<()>
Runs any command passed to it.
fn run_command_and_read_response(&mut self,
untagged_command: &str)
-> Result<Vec<String>>
untagged_command: &str)
-> Result<Vec<String>>