diff --git a/imap/Cargo.toml b/imap/Cargo.toml index 85c185e..99bd30a 100644 --- a/imap/Cargo.toml +++ b/imap/Cargo.toml @@ -18,8 +18,10 @@ path = "bin/mzhang_test.rs" required-features = ["stderrlog"] [features] -default = ["rfc2177-idle"] -rfc2177-idle = [] +default = ["rfc2177", "rfc6154"] +rfc2087 = [] # quota +rfc2177 = [] # idle +rfc6154 = [] # list [dependencies] anyhow = "1.0.42" diff --git a/imap/src/client/client.rs b/imap/src/client/client.rs index 9d77b6b..1d297d9 100644 --- a/imap/src/client/client.rs +++ b/imap/src/client/client.rs @@ -214,8 +214,8 @@ impl ClientAuthenticated { } /// Runs the IDLE command - #[cfg(feature = "rfc2177-idle")] - #[cfg_attr(docsrs, doc(cfg(feature = "rfc2177-idle")))] + #[cfg(feature = "rfc2177")] + #[cfg_attr(docsrs, doc(cfg(feature = "rfc2177")))] pub async fn idle(&mut self) -> Result { let cmd = Command::Idle; let stream = self.execute(cmd).await?; @@ -238,15 +238,15 @@ pub struct SelectResponse { /// /// Dropping this token indicates that the idling should be completed, and the /// DONE command will be sent to the server as a result. -#[cfg(feature = "rfc2177-idle")] -#[cfg_attr(docsrs, doc(cfg(feature = "rfc2177-idle")))] +#[cfg(feature = "rfc2177")] +#[cfg_attr(docsrs, doc(cfg(feature = "rfc2177")))] pub struct IdleToken { pub stream: ResponseStream, sender: mpsc::UnboundedSender, } -#[cfg(feature = "rfc2177-idle")] -#[cfg_attr(docsrs, doc(cfg(feature = "rfc2177-idle")))] +#[cfg(feature = "rfc2177")] +#[cfg_attr(docsrs, doc(cfg(feature = "rfc2177")))] impl Drop for IdleToken { fn drop(&mut self) { // TODO: should ignore this? @@ -254,8 +254,8 @@ impl Drop for IdleToken { } } -#[cfg(feature = "rfc2177-idle")] -#[cfg_attr(docsrs, doc(cfg(feature = "rfc2177-idle")))] +#[cfg(feature = "rfc2177")] +#[cfg_attr(docsrs, doc(cfg(feature = "rfc2177")))] impl Stream for IdleToken { type Item = Response; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> { diff --git a/imap/src/proto/command.rs b/imap/src/proto/command.rs index 30f5e91..c61a50b 100644 --- a/imap/src/proto/command.rs +++ b/imap/src/proto/command.rs @@ -39,7 +39,7 @@ pub enum Command { UidSearch(CommandSearch), // Extensions - #[cfg(feature = "rfc2177-idle")] + #[cfg(feature = "rfc2177")] Idle, } diff --git a/imap/src/proto/mod.rs b/imap/src/proto/mod.rs index d32f969..17fd2b4 100644 --- a/imap/src/proto/mod.rs +++ b/imap/src/proto/mod.rs @@ -14,6 +14,7 @@ pub mod response; // parsers pub mod rfc2234; pub mod rfc3501; +pub mod rfc6154; -#[cfg(feature = "rfc2177-idle")] +#[cfg(feature = "rfc2177")] pub mod rfc2177; diff --git a/imap/src/proto/rfc2177.rs b/imap/src/proto/rfc2177.rs index c6a85f8..c40d977 100644 --- a/imap/src/proto/rfc2177.rs +++ b/imap/src/proto/rfc2177.rs @@ -1 +1,4 @@ +//! IMAP `IDLE` Command +//! --- +//! //! Grammar from diff --git a/imap/src/proto/rfc2234.rs b/imap/src/proto/rfc2234.rs index 4cc8be8..a8e6405 100644 --- a/imap/src/proto/rfc2234.rs +++ b/imap/src/proto/rfc2234.rs @@ -1,3 +1,6 @@ +//! ABNF Core Rules +//! --- +//! //! Grammar from use nom::{branch::alt, multi::many0, sequence::pair}; diff --git a/imap/src/proto/rfc3501.rs b/imap/src/proto/rfc3501.rs index 8495fe0..b9e6b2f 100644 --- a/imap/src/proto/rfc3501.rs +++ b/imap/src/proto/rfc3501.rs @@ -1,3 +1,6 @@ +//! IMAP Specification +//! --- +//! //! Grammar from use nom::{ diff --git a/imap/src/proto/rfc6154.rs b/imap/src/proto/rfc6154.rs new file mode 100644 index 0000000..0ebf510 --- /dev/null +++ b/imap/src/proto/rfc6154.rs @@ -0,0 +1,4 @@ +//! IMAP `LIST` Extension +//! --- +//! +//! Grammar from