Struct imap::client::Client
[−]
[src]
pub struct Client<T: Read + Write> { 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>>
[src]
Creates a new client.
fn secure(
self,
domain: &str,
ssl_connector: TlsConnector
) -> Result<Client<TlsStream<TcpStream>>>
[src]
self,
domain: &str,
ssl_connector: TlsConnector
) -> Result<Client<TlsStream<TcpStream>>>
This will upgrade a regular TCP connection to use SSL.
Use the domain parameter for openssl's SNI and hostname verification.
impl Client<TlsStream<TcpStream>>
[src]
fn secure_connect<A: ToSocketAddrs>(
addr: A,
domain: &str,
ssl_connector: TlsConnector
) -> Result<Client<TlsStream<TcpStream>>>
[src]
addr: A,
domain: &str,
ssl_connector: TlsConnector
) -> Result<Client<TlsStream<TcpStream>>>
Creates a client with an SSL wrapper.
impl<T: Read + Write> Client<T>
[src]
fn new(stream: T) -> Client<T>
[src]
Creates a new client with the underlying stream.
fn authenticate<A: Authenticator>(
&mut self,
auth_type: &str,
authenticator: A
) -> Result<()>
[src]
&mut self,
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<()>
[src]
Log in to the IMAP server.
fn select(&mut self, mailbox_name: &str) -> Result<Mailbox>
[src]
Selects a mailbox
fn examine(&mut self, mailbox_name: &str) -> Result<Mailbox>
[src]
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>>
[src]
Fetch retreives data associated with a message in the mailbox.
fn uid_fetch(&mut self, uid_set: &str, query: &str) -> Result<Vec<String>>
[src]
fn noop(&mut self) -> Result<()>
[src]
Noop always succeeds, and it does nothing.
fn logout(&mut self) -> Result<()>
[src]
Logout informs the server that the client is done with the connection.
fn create(&mut self, mailbox_name: &str) -> Result<()>
[src]
Create creates a mailbox with the given name.
fn delete(&mut self, mailbox_name: &str) -> Result<()>
[src]
Delete permanently removes the mailbox with the given name.
fn rename(
&mut self,
current_mailbox_name: &str,
new_mailbox_name: &str
) -> Result<()>
[src]
&mut self,
current_mailbox_name: &str,
new_mailbox_name: &str
) -> Result<()>
Rename changes the name of a mailbox.
fn subscribe(&mut self, mailbox: &str) -> Result<()>
[src]
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<()>
[src]
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>>
[src]
Capability requests a listing of capabilities that the server supports.
fn expunge(&mut self) -> Result<()>
[src]
Expunge permanently removes all messages that have the \Deleted flag set from the currently selected mailbox.
fn check(&mut self) -> Result<()>
[src]
Check requests a checkpoint of the currently selected mailbox.
fn close(&mut self) -> Result<()>
[src]
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>>
[src]
Store alters data associated with a message in the mailbox.
fn uid_store(&mut self, uid_set: &str, query: &str) -> Result<Vec<String>>
[src]
fn copy(&mut self, sequence_set: &str, mailbox_name: &str) -> Result<()>
[src]
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<()>
[src]
fn list(
&mut self,
reference_name: &str,
mailbox_search_pattern: &str
) -> Result<Vec<String>>
[src]
&mut self,
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>>
[src]
&mut self,
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>>
[src]
&mut self,
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>>
[src]
Returns a handle that can be used to block until the state of the currently selected mailbox changes.
fn append(&mut self, folder: &str, content: &[u8]) -> Result<Vec<String>>
[src]
The APPEND command adds a mail to a mailbox.
fn run_command_and_check_ok(&mut self, command: &str) -> Result<()>
[src]
Runs a command and checks if it returns OK.
fn run_command_and_parse(&mut self, command: &str) -> Result<Vec<String>>
[src]
fn run_command(&mut self, untagged_command: &str) -> Result<()>
[src]
Runs any command passed to it.
fn run_command_and_read_response(
&mut self,
untagged_command: &str
) -> Result<Vec<String>>
[src]
&mut self,
untagged_command: &str
) -> Result<Vec<String>>