Generate docs with cfg badges

This commit is contained in:
ItsEthra 2023-11-30 18:10:49 +03:00
parent 6af52af17f
commit 63efc3ffd5
4 changed files with 10 additions and 0 deletions

View file

@ -12,6 +12,7 @@ edition = "2021"
[features] [features]
default = [] default = []
unstable = []
guards = ["tower", "futures-core", "pin-project-lite"] guards = ["tower", "futures-core", "pin-project-lite"]
serde = ["dep:serde", "dep:serde_json"] serde = ["dep:serde", "dep:serde_json"]
@ -26,3 +27,6 @@ pin-project-lite = { version = "0.2", optional = true }
# Optional dependencies required for the `serde` feature. # Optional dependencies required for the `serde` feature.
serde = { version = "1", features = ["derive"], optional = true } serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true } serde_json = { version = "1", optional = true }
[package.metadata.docs.rs]
all-features = true

View file

@ -51,6 +51,7 @@ impl<'a, S> Layer<S> for HxRequestGuardLayer<'a> {
} }
} }
/// Tower service that implementes redirecting to non-partial routes.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct HxRequestGuard<'a, S> { pub struct HxRequestGuard<'a, S> {
inner: S, inner: S,

View file

@ -1,13 +1,17 @@
#![cfg_attr(feature = "unstable", feature(doc_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![forbid(unsafe_code)] #![forbid(unsafe_code)]
pub mod extractors; pub mod extractors;
#[cfg(feature = "guards")] #[cfg(feature = "guards")]
#[cfg_attr(feature = "unstable", doc(cfg(feature = "guards")))]
pub mod guard; pub mod guard;
pub mod headers; pub mod headers;
pub mod responders; pub mod responders;
pub use extractors::*; pub use extractors::*;
#[cfg(feature = "guards")] #[cfg(feature = "guards")]
#[cfg_attr(feature = "unstable", doc(cfg(feature = "guards")))]
pub use guard::*; pub use guard::*;
pub use headers::*; pub use headers::*;
pub use responders::*; pub use responders::*;

View file

@ -10,6 +10,7 @@ use axum::{
use crate::headers; use crate::headers;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
#[cfg_attr(feature = "unstable", doc(cfg(feature = "serde")))]
pub mod serde; pub mod serde;
const HX_SWAP_INNER_HTML: &str = "innerHTML"; const HX_SWAP_INNER_HTML: &str = "innerHTML";