From 28faa816a9dacbf25a8bdb7edcc6ac67212e5ff2 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 31 Mar 2024 10:03:15 +0200 Subject: [PATCH] Fix up doc links --- src/client.rs | 7 ++++--- src/error.rs | 3 ++- src/testing.rs | 2 ++ src/types/appended.rs | 3 +++ src/types/flag.rs | 3 +++ src/types/quota.rs | 6 +++--- src/types/unsolicited_response.rs | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/client.rs b/src/client.rs index 3af76cf..06a8ba6 100644 --- a/src/client.rs +++ b/src/client.rs @@ -8,15 +8,16 @@ use std::ops::{Deref, DerefMut}; use std::str; use std::sync::mpsc; -use crate::error::TagMismatch; - use super::authenticator::Authenticator; -use super::error::{Bad, Bye, Error, No, ParseError, Result, ValidateError}; +use super::error::{Bad, Bye, Error, No, ParseError, Result, TagMismatch, ValidateError}; use super::extensions; use super::parse::*; use super::types::*; use super::utils::*; +#[cfg(doc)] +use imap_proto::NameAttribute; + static TAG_PREFIX: &str = "a"; const INITIAL_TAG: u32 = 0; const CR: u8 = 0x0d; diff --git a/src/error.rs b/src/error.rs index b1f75f0..178e9b0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -108,7 +108,8 @@ pub enum Error { /// The server responded with a different command tag than the one we just sent. /// /// A new session must generally be established to recover from this. You can also use - /// [`Connection::skip_tag`] (which is available through both [`Client`] and [`Session`]). + /// [`Connection::skip_tag`](crate::client::Connection::skip_tag) (which is available through + /// both [`Client`](crate::Client) and [`Session`](crate::Session)). TagMismatch(TagMismatch), /// StartTls is not available on the server StartTlsNotAvailable, diff --git a/src/testing.rs b/src/testing.rs index c5f7f52..89460f3 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -13,6 +13,8 @@ //! imap = { version = "3.0", features = ["test_helpers"] } //! ``` //! +#[cfg(doc)] +use crate::{extensions::list_status::ExtendedNames, types::*}; /// Methods to build a [`Capabilities`] response object pub mod capabilities { diff --git a/src/types/appended.rs b/src/types/appended.rs index 72de85a..e1d470a 100644 --- a/src/types/appended.rs +++ b/src/types/appended.rs @@ -1,5 +1,8 @@ use imap_proto::UidSetMember; +#[cfg(doc)] +use crate::types::Uid; + /// Meta-information about a message, as returned by /// [`APPEND`](https://tools.ietf.org/html/rfc3501#section-6.3.11). /// Note that `APPEND` only returns any data if certain extensions are enabled, diff --git a/src/types/flag.rs b/src/types/flag.rs index a1bb9a9..8c5161d 100644 --- a/src/types/flag.rs +++ b/src/types/flag.rs @@ -1,5 +1,8 @@ use std::borrow::Cow; +#[cfg(doc)] +use crate::types::Mailbox; + /// With the exception of [`Flag::Custom`], these flags are system flags that are pre-defined in /// [RFC 3501 section 2.3.2](https://tools.ietf.org/html/rfc3501#section-2.3.2). All system flags /// begin with `\` in the IMAP protocol. Certain system flags (`\Deleted` and `\Seen`) have diff --git a/src/types/quota.rs b/src/types/quota.rs index 72d1506..ac9d5e8 100644 --- a/src/types/quota.rs +++ b/src/types/quota.rs @@ -9,7 +9,7 @@ use std::sync::mpsc; /// From [SETQUOTA Resource limit](https://datatracker.ietf.org/doc/html/rfc2087#section-4.1) /// -/// Used by [`Session::set_quota`] +/// Used by [`Session::set_quota`](crate::Session::set_quota). #[derive(Clone, Debug, Eq, PartialEq)] #[non_exhaustive] pub struct QuotaResourceLimit<'a> { @@ -35,7 +35,7 @@ impl Display for QuotaResourceLimit<'_> { /// From [Resources](https://datatracker.ietf.org/doc/html/rfc2087#section-3) /// -/// Used by [`QuotaLimit`], and [`QuotaResource`] +/// Used by [`QuotaResourceLimit`], and [`QuotaResource`] #[derive(Debug, Eq, PartialEq, Clone)] #[non_exhaustive] pub enum QuotaResourceName<'a> { @@ -128,7 +128,7 @@ impl QuotaResponse { /// From [QUOTA Response](https://datatracker.ietf.org/doc/html/rfc2087#section-5.1) /// -/// Used by [`QuotaResponse`] and [`QuotaRoot`] +/// Used by [`QuotaResponse`] and [`QuotaRootResponse`] #[derive(Debug, Eq, PartialEq)] #[non_exhaustive] pub struct Quota<'a> { diff --git a/src/types/unsolicited_response.rs b/src/types/unsolicited_response.rs index 7e07265..c72f59c 100644 --- a/src/types/unsolicited_response.rs +++ b/src/types/unsolicited_response.rs @@ -75,7 +75,7 @@ pub enum UnsolicitedResponse { // TODO: the spec doesn't seem to say anything about when these may be received as unsolicited? Flags(Vec>), - /// An unsolicited METADATA response (https://tools.ietf.org/html/rfc5464#section-4.4.2) + /// An unsolicited [METADATA response](https://tools.ietf.org/html/rfc5464#section-4.4.2) /// that reports a change in a server or mailbox annotation. Metadata { /// Mailbox name for which annotations were changed.