abpl 0.1.4

A collection of Rust boilerplate: a reloadable-systemd-service lifecycle helper, a hot-reloading axum wrapper, a serializable/typed error derive macro, and small utility newtypes.
Documentation
[workspace]
members = [".", "abpl-macros"]

[package]
name = "abpl"
version = "0.1.4"
edition = "2024"
rust-version = "1.95"
license = "AGPL-3.0-or-later"
repository = "https://github.com/ARitz-Cracker/abpl"
description = "A collection of Rust boilerplate: a reloadable-systemd-service lifecycle helper, a hot-reloading axum wrapper, a serializable/typed error derive macro, and small utility newtypes."
keywords = ["systemd", "axum", "tokio", "error-handling", "boilerplate"]
categories = ["os::linux-apis", "web-programming::http-server", "asynchronous", "rust-patterns", "config"]

[dependencies]
abpl-macros = { path = "./abpl-macros", version = "0.1.0", optional = true }
tracing = "0.1.44"
serde = { version = "1.0.228", optional = true }
serde_with = {version = "3.15.1", optional = true }
bytes = {version = "1.12.0", optional = true }
base64 = {version = "0.22.1", optional = true }

utoipa = { version = "5.4.0", optional = true }
http = { version = "1.4.2", optional = true }
indenter = { version = "0.3.4", optional = true }
tracing-subscriber = {version = "0.3.23", optional = true, default-features = false}
tracing-journald = {version = "0.3.2", optional = true, default-features = false}
tokio = {version = "1.53.0", optional = true, default-features = false}
axum = {version = "0.8.9", optional = true, default-features = false}
tower-service = {version = "0.3.3", optional = true, default-features = false}
futures = {version = "0.3.32", optional = true, default-features = false}
toml = {version = "1.1.3", optional = true, default-features = false}
libc = {version = "0.2.186", optional = true}
signal-hook = {version = "0.4.4", optional = true}
url = {version = "2.5.8", optional = true}


[features]
# A newtype for byte arrays to be (de)serialized as base64
newtype_base64 = ["serde", "bytes", "base64"]
serde = ["dep:serde", "serde/derive", "serde/rc", "dep:serde_with"]
http = ["future_util", "serde", "dep:http", "dep:tokio", "tokio/net", "dep:axum", "dep:tower-service", "axum/tokio", "axum/http1", "axum/http2", "dep:futures", "futures/alloc"]
future_util = ["dep:tokio", "tokio/rt", "dep:futures"]

# Derive error serde stuff
derive_error = ["abpl-macros", "indenter"]

default = ["std"]

# currently disabling this brakes things
std = []

# automagic app lifecycle management
app = ["derive_error", "serde", "toml", "toml/serde", "toml/parse", "tracing-subscriber", "tracing-subscriber/env-filter", "tracing-subscriber/fmt", "tracing-journald", "libc", "signal-hook", "sd-notify", "url"]

# Thread utilities, currently includes a cancelable sleep
thread = [ ]

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

[dev-dependencies]
serde_json = { version = "1.0.150" }
tempfile = { version = "3.23.0" }

[target.'cfg(target_os = "linux")'.dependencies]
# TODO: Create a stub dependency that does nothing on non-linux platforms so that the feature list still works.
# I tried doing platform-specific feature lists for "app", but that didn't work
sd-notify = {version = "0.4.5", optional = true, default-features = false}