panorama/imap/src/command/mod.rs

20 lines
522 B
Rust
Raw Normal View History

2021-02-20 05:03:33 +00:00
use std::fmt;
/// Commands, without the tag part.
2021-02-20 07:30:58 +00:00
#[derive(Clone, Debug)]
2021-02-20 05:03:33 +00:00
pub enum Command {
Capability,
2021-02-21 13:42:40 +00:00
Starttls,
2021-02-23 02:47:00 +00:00
Login { username: String, password: String },
2021-02-20 05:03:33 +00:00
}
impl fmt::Display for Command {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Command::Capability => write!(f, "CAPABILITY"),
2021-02-21 13:42:40 +00:00
Command::Starttls => write!(f, "STARTTLS"),
2021-02-23 02:47:00 +00:00
Command::Login { username, password } => write!(f, "LOGIN {} {}", username, password),
2021-02-20 05:03:33 +00:00
}
}
}