Skip to main content

imap_client/
lib.rs

1#![forbid(unsafe_code)]
2
3pub mod capabilities;
4pub mod client;
5pub mod credentials;
6pub mod error;
7pub mod flags;
8pub mod idle;
9pub mod search;
10pub mod session;
11
12pub use capabilities::Capabilities;
13pub use client::RawClient;
14pub use error::ClientError;
15pub use flags::{Flag, StoreAction};
16pub use search::{SearchKey, SearchQuery};
17pub use session::{Authenticated, PlainText, Selected, Session, Tls, Unauthenticated};
18
19#[cfg(test)]
20mod tests {
21
22    #[test]
23    fn test_type_states() {
24        // This test ensures that the generic state machine builds and provides the expected interface.
25        // We cannot call .fetch() on an Unauthenticated session, and we cannot call login() on a PlainText session!
26
27        // let raw = RawClient::new(mock_stream);
28        // let unauth = Session::<Unauthenticated, Tls>::new(raw, Capabilities::default());
29        // let auth = unauth.login("user", credentials::Password::new("pass")).await.unwrap();
30    }
31}