Adding docs for pub functions that run commands

This commit is contained in:
Matt McCoy 2016-06-22 21:14:24 -04:00
parent e344438e60
commit 2011d3a92a

View file

@ -145,6 +145,7 @@ impl<T: Read+Write> Client<T> {
self.run_command_and_check_ok(&format!("COPY {} {}", sequence_set, mailbox_name).to_string()) self.run_command_and_check_ok(&format!("COPY {} {}", sequence_set, mailbox_name).to_string())
} }
/// Runs a command and checks if it returns OK.
pub fn run_command_and_check_ok(&mut self, command: &str) -> Result<()> { pub fn run_command_and_check_ok(&mut self, command: &str) -> Result<()> {
match self.run_command(command) { match self.run_command(command) {
Ok(lines) => parse_response_ok(lines), Ok(lines) => parse_response_ok(lines),
@ -152,6 +153,7 @@ impl<T: Read+Write> Client<T> {
} }
} }
/// Runs any command passed to it.
pub fn run_command(&mut self, untagged_command: &str) -> Result<Vec<String>> { pub fn run_command(&mut self, untagged_command: &str) -> Result<Vec<String>> {
let command = self.create_command(untagged_command.to_string()); let command = self.create_command(untagged_command.to_string());