From 18ca5e540d2eb966aef2db2ceaa1e7692c92850a Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Sun, 21 Feb 2021 08:02:26 -0600 Subject: [PATCH] Update documentation --- imap/src/client/mod.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/imap/src/client/mod.rs b/imap/src/client/mod.rs index 1931306..23b63f6 100644 --- a/imap/src/client/mod.rs +++ b/imap/src/client/mod.rs @@ -12,6 +12,26 @@ //! //! If you choose not to use the high-level type-safe features of `ClientBuilder`, then you can //! also choose to access the lower level [`Client`][self::inner::Client] directly. +//! +//! Example +//! --- +//! +//! The following example connects to `mywebsite.com:143` using STARTTLS. +//! +//! ```no_run +//! # use anyhow::Result; +//! # use panorama_imap::client::ClientConfigBuilder; +//! # async fn test() -> Result<()> { +//! let config = ClientConfigBuilder::default() +//! .hostname("mywebsite.com".to_owned()) +//! .port(143) +//! .tls(false) +//! .build().unwrap(); +//! let insecure = config.open().await?; +//! let unauth = insecure.upgrade().await?; +//! # Ok(()) +//! # } +//! ``` mod inner;