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
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.88"
name = "rust-web-utils"
version = "0.1.0"
build = false
exclude = [
    "docs/",
    ".github/",
    "CLAUDE.md",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "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"
homepage = "https://rust-web-utils.czl.net"
documentation = "https://rust-web-utils.czl.net/docs"
readme = "README.md"
keywords = [
    "web",
    "http",
    "axum",
    "client-ip",
    "nextjs",
]
categories = [
    "web-programming",
    "web-programming::http-server",
]
license = "MIT"
repository = "https://github.com/woodchen-ink/rust-web-utils"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
axum = [
    "dep:axum",
    "axum/tokio",
]
cookieutil = [
    "dep:getrandom",
    "dep:base64",
    "dep:subtle",
    "dep:httpdate",
]
cronutil = [
    "dep:tokio",
    "tokio/rt",
    "tokio/time",
    "tokio/sync",
    "tokio/macros",
]
default = [
    "iputil",
    "uautil",
    "resputil",
    "timex",
    "cookieutil",
    "cronutil",
    "nextstatic",
]
iputil = []
nextstatic = [
    "dep:tokio",
    "tokio/fs",
    "dep:tower-http",
    "dep:tower-service",
    "dep:bytes",
    "dep:http-body-util",
    "dep:percent-encoding",
]
resputil = [
    "dep:serde",
    "dep:serde_json",
    "dep:bytes",
    "dep:http-body-util",
]
timex = [
    "dep:chrono",
    "dep:chrono-tz",
]
tower = [
    "uautil",
    "dep:tower-layer",
    "dep:tower-service",
    "dep:bytes",
    "dep:http-body-util",
]
uautil = []

[lib]
name = "rust_web_utils"
path = "src/lib.rs"

[[test]]
name = "axum"
path = "tests/axum.rs"

[[test]]
name = "nextstatic"
path = "tests/nextstatic.rs"

[dependencies.axum]
version = "0.8"
optional = true
default-features = false

[dependencies.base64]
version = "0.23"
optional = true

[dependencies.bytes]
version = "1"
optional = true

[dependencies.chrono]
version = "0.4.40"
features = [
    "clock",
    "std",
]
optional = true
default-features = false

[dependencies.chrono-tz]
version = "0.10"
optional = true

[dependencies.getrandom]
version = "0.4"
optional = true

[dependencies.http]
version = "1.3"

[dependencies.http-body-util]
version = "0.1"
optional = true

[dependencies.httpdate]
version = "1"
optional = true

[dependencies.percent-encoding]
version = "2"
optional = true

[dependencies.serde]
version = "1"
optional = true

[dependencies.serde_json]
version = "1"
optional = true

[dependencies.subtle]
version = "2.6"
optional = true

[dependencies.thiserror]
version = "2"

[dependencies.tokio]
version = "1.40"
optional = true
default-features = false

[dependencies.tower-http]
version = "0.7"
features = ["fs"]
optional = true
default-features = false

[dependencies.tower-layer]
version = "0.3"
optional = true

[dependencies.tower-service]
version = "0.3"
optional = true

[dev-dependencies.axum]
version = "0.8"
features = [
    "tokio",
    "http1",
]
default-features = false

[dev-dependencies.serde]
version = "1"
features = ["derive"]

[dev-dependencies.tempfile]
version = "3"

[dev-dependencies.tokio]
version = "1.40"
features = [
    "rt-multi-thread",
    "macros",
    "time",
    "test-util",
]

[dev-dependencies.tower]
version = "0.5"
features = ["util"]

[lints.clippy.all]
level = "warn"
priority = -1

[lints.rust]
missing_docs = "warn"
unsafe_code = "forbid"