diff --git a/Cargo.toml b/Cargo.toml index 01a19a8..e00b5f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,3 +19,16 @@ notify = ["dep:libc", "dep:rustix"] libc = { version = "0.2.150", optional = true } rustix = { version = "0.38.26", optional = true, features = ["net"] } tracing = { version = "0.1.40", default-features = false, features = ["std", "log"] } + +[package.metadata.docs.rs] +features = ["listenfd", "notify"] +rustdoc-args = ["--cfg", "doc_cfg"] +targets = [ + "x86_64-unknown-linux-gnu", + "i686-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-unknown-freebsd", + "x86_64-unknown-openbsd", + "x86_64-unknown-netbsd", + "wasm32-unknown-emscripten" +] diff --git a/src/lib.rs b/src/lib.rs index 1d4e6ab..c62e858 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,10 @@ +//! A library permitting interaction with the LISTEN_FDS and NOTIFY_SOCKET protocol. + +#![cfg_attr(doc_cfg, feature(doc_cfg))] + #[cfg(feature = "listenfd")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "listenfd")))] pub mod listen; #[cfg(feature = "notify")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "notify")))] pub mod notify; diff --git a/src/listen/mod.rs b/src/listen/mod.rs index 5bd7763..59b7f4d 100644 --- a/src/listen/mod.rs +++ b/src/listen/mod.rs @@ -104,7 +104,7 @@ impl FileDescriptor { /// /// # Errors /// - /// This function will fail if no file descriptor colud be received which might not actually be an error. See [`ReceiveError`] for details. + /// This function will fail if no file descriptor could be received which might not actually be an error. See [`ReceiveError`] for details. pub fn receive( unset_env: bool, ) -> Result>, ReceiveError> { @@ -127,7 +127,7 @@ impl FileDescriptor { /// /// # Errors /// - /// This function will fail if no file descriptor colud be received which might not actually be an error. See [`ReceiveError`] for details. + /// This function will fail if no file descriptor could be received which might not actually be an error. See [`ReceiveError`] for details. /// /// # Safety ///