modrun 1.1.0

Modular application composer for Tokio: domain modules, typed wiring, lifecycle
Documentation
[package]
name = "modrun"
version = "1.1.0"
edition = "2024"
# Keep aligned with CI MSRV job (edition 2024). CI tests the library with
# `cargo test` (not `--all-targets`) so examples/benches may depend on crates
# with a higher MSRV (e.g. axum).
rust-version = "1.85"
description = "Modular application composer for Tokio: domain modules, typed wiring, lifecycle"
license = "MIT"
readme = "README.md"
authors = ["shmy <chao.w1226@gmail.com>"]
repository = "https://github.com/shmy/modrun"
homepage = "https://github.com/shmy/modrun"
documentation = "https://docs.rs/modrun"
keywords = ["modular", "lifecycle", "tokio", "async", "wiring"]
categories = ["asynchronous", "development-tools", "rust-patterns"]
exclude = [".github", "justfile"]

[package.metadata.docs.rs]
all-features = true

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

[features]
default = ["signal", "logging", "env-filter"]
# Fx-style console logging via `modrun::logging`. `fmt`-only: pulls no regex
# crates. Enable `env-filter` on top for `RUST_LOG` / per-target filtering.
logging = ["dep:tracing-subscriber"]
# `RUST_LOG` and per-target filtering for `modrun::logging`. Adds the
# `tracing-subscriber/env-filter` layer (regex-automata, matchers). Implies
# `logging`. Disable via `default-features = false` + `features = ["logging"]`
# to keep console logging without the regex dependencies.
env-filter = ["logging", "tracing-subscriber/env-filter"]
# OS signal listeners for `ModrunBuilder::run`. Disable with
# `default-features = false` when you only call `start()` or drive shutdown
# via `Shutdowner`.
signal = ["tokio/signal"]

[dependencies]
thiserror = { version = "2", default-features = false, features = ["std"] }
tokio = { version = "1", default-features = false, features = [
    "rt",
    "time",
    "macros",
    "sync",
] }
tracing = { version = "0.1", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3", optional = true, default-features = false, features = [
    "fmt",
    "std",
] }

[dev-dependencies]
axum = "0.8"
criterion = { version = "0.7", features = ["async_tokio"] }
tokio = { version = "1", default-features = false, features = [
    "rt-multi-thread",
    "macros",
    "sync",
    "time",
    "net",
    "signal",
] }
tracing-subscriber = { version = "0.3", default-features = false, features = [
    "env-filter",
    "ansi",
    "fmt",
    "std",
] }

[lints.rust]
missing_docs = "warn"

[lints.clippy]
dbg_macro = "warn"
todo = "warn"

[[bench]]
name = "build"
harness = false

[[example]]
name = "basic"
path = "examples/basic.rs"
required-features = ["logging"]

[[example]]
name = "axum"
path = "examples/axum.rs"
required-features = ["logging"]

[[example]]
name = "worker"
path = "examples/worker.rs"
required-features = ["logging"]

[[example]]
name = "handlers"
path = "examples/handlers.rs"
required-features = ["logging"]

[[example]]
name = "swap"
path = "examples/swap.rs"
required-features = ["logging"]

[[example]]
name = "wrap"
path = "examples/wrap.rs"
required-features = ["logging"]