rust-web-utils 0.1.0

Lightweight web utilities: client IP & trusted proxies, bot/browser detection, unified JSON response, business timezone, auth cookies + CSRF, cron guards, Next.js static export hosting
Documentation
//! rust-web-utils: CZL Web 服务的公共工具库, 与 Go 版
//! [go-web-utils](https://github.com/woodchen-ink/go-web-utils) 语义对齐。
//!
//! 基于 [`http`] crate 的通用类型 (`HeaderMap` / `Request` / `Response`) 实现,
//! 不绑定具体框架; 开启 `axum` feature 后提供 Axum 集成, `tower` feature 提供
//! tower 中间件。
//!
//! | 模块 | 用途 | feature |
//! |------|------|---------|
//! | [`iputil`] | 客户端真实 IP、可信代理、IP 校验与 CIDR | `iputil` |
//! | [`uautil`] | 机器人 / 浏览器识别与拦截中间件 | `uautil` (`tower` 开中间件) |
//! | [`resputil`] | 统一 JSON 响应 `{ code, data, msg }` | `resputil` |
//! | [`timex`] | 业务时区初始化与自然日 / 周 / 月边界 | `timex` |
//! | [`cookieutil`] | 安全默认值的认证 Cookie 与 CSRF double-submit | `cookieutil` |
//! | [`cronutil`] | 空轮退避、防重叠、去抖聚合队列 | `cronutil` |
//! | [`nextstatic`] | Next.js 15/16 静态导出托管 | `nextstatic` |
//!
//! 默认开启全部模块 (不含 `axum` / `tower`)。按需裁剪:
//!
//! ```toml
//! [dependencies]
//! rust-web-utils = { git = "https://github.com/woodchen-ink/rust-web-utils", tag = "v0.1.0", default-features = false, features = ["iputil", "resputil", "axum"] }
//! ```
//!
//! 完整文档: <https://rust-web-utils.czl.net/docs>
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(feature = "cookieutil")]
pub mod cookieutil;
#[cfg(feature = "cronutil")]
pub mod cronutil;
#[cfg(feature = "iputil")]
pub mod iputil;
#[cfg(feature = "nextstatic")]
pub mod nextstatic;
#[cfg(feature = "resputil")]
pub mod resputil;
#[cfg(feature = "timex")]
pub mod timex;
#[cfg(feature = "uautil")]
pub mod uautil;