-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
109 lines (98 loc) · 3.98 KB
/
Cargo.toml
File metadata and controls
109 lines (98 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
[package]
name = "error-forge"
# 1.0.0 (2026-05-18) — stable API. Public surface frozen under
# SemVer for the entire 1.x line. See docs/STABILITY.md for the
# binding contract and docs/API-FREEZE-AUDIT.md for the surface
# manifest. Major changes vs 0.9.x: `group!` macro rewritten
# (requires `: ForgeError` on wrapped types), `CircuitBreaker`
# switched to `parking_lot::Mutex` (no poisoning), hook callback
# widened to `Box<dyn Fn>`, `#[non_exhaustive]` on several
# public types, `Result<T>` deprecated in favour of `AppResult<T>`,
# `register_error_hook` (non-try) deprecated, `rand` gated behind
# new `jitter` feature.
version = "1.0.0"
edition = "2021"
# MSRV. The crate uses `io::Error::other` (stabilised 1.74),
# `Mutex::new()` in const context (1.63 — fine), and Cargo lockfile
# format v4 (default since 1.78, can't be parsed by older
# toolchains). `1.81` is also the floor required by clippy's
# `incompatible_msrv` lint on the current source, and matches
# `mod-events` in this workspace for consistency. CI verifies on
# 1.81.0 in a dedicated MSRV job.
rust-version = "1.81"
readme = "README.md"
license = "Apache-2.0"
authors = [
"James Gober <me@jamesgober.com>"
]
description = "Pragmatic Rust error-handling framework with stable error metadata, contextual diagnostics, optional async support, and synchronous recovery primitives (retry, circuit-breaker, backoff). Optional #[derive(ModError)], declarative define_errors!, and feature-gated logging / tracing / serde adapters."
keywords = [
"error",
"error-handling",
"async",
"resilience",
"circuit-breaker"
]
categories = [
"rust-patterns",
"development-tools::debugging",
"asynchronous",
"development-tools"
]
documentation = "https://docs.rs/error-forge"
repository = "https://github.com/jamesgober/error-forge"
homepage = "https://github.com/jamesgober/error-forge"
# Configuration for docs.rs
[package.metadata.docs.rs]
# Enable all features when building docs
all-features = true
# Enable specific features for documentation
features = ["derive", "serde", "console", "backtrace"]
# Set specific rustdoc flags
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
thiserror = "1.0"
# `pastey` is a drop-in fork of `paste`. The original `paste` crate
# was archived by its author on 2024-10-07 (RUSTSEC-2024-0436,
# "unmaintained"); `pastey` keeps the public `paste!` macro API and
# behaviour, with the same `[<...>]` token-pasting and case-modifier
# syntax `define_errors!` relies on.
pastey = "0.2"
# `parking_lot` provides a non-poisoning `Mutex` used by
# `CircuitBreaker`'s internal state. The standard `std::sync::Mutex`
# poisons on panic, which is incompatible with this crate's
# error-handling premise; `parking_lot::Mutex` returns the guard
# directly with no `Result` to unwrap.
parking_lot = "0.12"
error-forge-derive = {version = "1.0.0", path = "./error-forge-derive", optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
log = { version = "0.4", optional = true }
tracing = { version = "0.1", optional = true }
async-trait = { version = "0.1.74", optional = true }
# `rand` is only used to add ±20% jitter to `ExponentialBackoff` when
# the caller opts in. Gated behind the `jitter` feature so users who
# never call `ExponentialBackoff::with_jitter(true)` don't pay for
# `rand`'s transitive deps (`getrandom`, `rand_core`, `rand_chacha`,
# `ppv-lite86`).
rand = { version = "0.8.5", optional = true }
[features]
default = []
derive = ["error-forge-derive"]
serde = ["dep:serde"]
console = []
backtrace = []
# Enables ±20% jitter in `recovery::ExponentialBackoff::with_jitter`.
# Pulls in `rand` for non-cryptographic random delays. Off by
# default — backoff still works without it, jitter is a no-op.
jitter = ["dep:rand"]
log = ["dep:log"]
tracing = ["dep:tracing"]
registry = []
collector = []
context = []
async = ["dep:async-trait"]
[workspace]
members = ["error-forge-derive"]
[dev-dependencies]
serde_json = "1.0"
tokio = { version = "1.52", features = ["full", "test-util", "macros"] }