# 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 = "seatbelt"
version = "0.4.3"
authors = ["The Oxidizer Project Authors"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Resilience and recovery mechanisms for fallible operations."
homepage = "https://github.com/microsoft/oxidizer"
readme = "README.md"
keywords = [
    "oxidizer",
    "resilience",
    "layered",
    "recovery",
    "retry",
]
categories = ["data-structures"]
license = "MIT"
repository = "https://github.com/microsoft/oxidizer/tree/main/crates/seatbelt"
resolver = "2"

[package.metadata.cargo_check_external_types]
allowed_external_types = [
    "layered::layer::stack::Stack",
    "layered::service::Service",
    "opentelemetry::metrics::meter::MeterProvider",
    "recoverable::Recovery",
    "recoverable::RecoveryInfo",
    "recoverable::RecoveryKind",
    "serde_core::de::*",
    "serde_core::ser::*",
    "tick::clock::Clock",
    "tower_layer::Layer",
    "tower_service::Service",
    "thread_aware::core::ThreadAware",
    "thread_aware::affinity::MemoryAffinity",
    "thread_aware::affinity::PinnedAffinity",
]

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

[features]
breaker = ["dep:fastrand"]
chaos-injection = ["dep:fastrand"]
default = []
fallback = []
hedging = ["dep:futures-util"]
logs = ["dep:tracing"]
metrics = [
    "dep:opentelemetry",
    "opentelemetry/metrics",
]
retry = ["dep:fastrand"]
serde = [
    "dep:serde",
    "dep:jiff",
]
timeout = []
tower-service = ["dep:tower-service"]

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

[[example]]
name = "breaker"
path = "examples/breaker.rs"
required-features = [
    "breaker",
    "metrics",
    "chaos-injection",
]

[[example]]
name = "chaos_injection"
path = "examples/chaos_injection.rs"
required-features = ["chaos-injection"]

[[example]]
name = "chaos_injection_advanced"
path = "examples/chaos_injection_advanced.rs"
required-features = ["chaos-injection"]

[[example]]
name = "config"
path = "examples/config.rs"
required-features = [
    "retry",
    "breaker",
    "timeout",
    "serde",
]

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

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

[[example]]
name = "resilience_pipeline"
path = "examples/resilience_pipeline.rs"
required-features = [
    "retry",
    "timeout",
    "metrics",
]

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

[[example]]
name = "retry_advanced"
path = "examples/retry_advanced.rs"
required-features = [
    "retry",
    "metrics",
]

[[example]]
name = "retry_outage"
path = "examples/retry_outage.rs"
required-features = [
    "retry",
    "metrics",
]

[[example]]
name = "timeout"
path = "examples/timeout.rs"
required-features = [
    "timeout",
    "metrics",
]

[[example]]
name = "timeout_advanced"
path = "examples/timeout_advanced.rs"
required-features = [
    "timeout",
    "metrics",
]

[[example]]
name = "tower"
path = "examples/tower.rs"
required-features = [
    "retry",
    "timeout",
    "tower-service",
]

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

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

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

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

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

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

[[bench]]
name = "breaker"
path = "benches/breaker.rs"
harness = false
required-features = ["breaker"]

[[bench]]
name = "hedging"
path = "benches/hedging.rs"
harness = false
required-features = ["hedging"]

[[bench]]
name = "observability"
path = "benches/observability.rs"
harness = false
required-features = [
    "retry",
    "logs",
    "metrics",
]

[[bench]]
name = "retry"
path = "benches/retry.rs"
harness = false
required-features = ["retry"]

[[bench]]
name = "timeout"
path = "benches/timeout.rs"
harness = false
required-features = ["timeout"]

[dependencies.fastrand]
version = "2.3.0"
features = ["std"]
optional = true
default-features = false

[dependencies.futures-util]
version = "0.3.31"
features = ["alloc"]
optional = true
default-features = false

[dependencies.jiff]
version = "0.2.21"
features = [
    "std",
    "serde",
]
optional = true
default-features = false

[dependencies.layered]
version = "0.3.0"
default-features = false

[dependencies.opentelemetry]
version = "0.31.0"
optional = true
default-features = false

[dependencies.recoverable]
version = "0.1.1"
default-features = false

[dependencies.serde]
version = "1.0.228"
features = [
    "std",
    "derive",
]
optional = true
default-features = false

[dependencies.thread_aware]
version = "0.6.2"
default-features = false

[dependencies.tick]
version = "0.2.1"
default-features = false

[dependencies.tower-service]
version = "0.3.3"
optional = true
default-features = false

[dependencies.tracing]
version = "0.1.41"
optional = true
default-features = false

[dev-dependencies.alloc_tracker]
version = "0.5.9"
default-features = false

[dev-dependencies.criterion]
version = "0.8.1"
default-features = false

[dev-dependencies.fastrand]
version = "2.3.0"
features = ["std"]
default-features = false

[dev-dependencies.futures]
version = "0.3.31"
features = ["executor"]
default-features = false

[dev-dependencies.futures-util]
version = "0.3.31"
features = ["alloc"]
default-features = false

[dev-dependencies.http]
version = "1.2.0"
features = ["std"]
default-features = false

[dev-dependencies.insta]
version = "1.44.1"
features = ["json"]
default-features = false

[dev-dependencies.jiff]
version = "0.2.21"
features = ["serde"]
default-features = true

[dev-dependencies.layered]
version = "0.3.0"
features = [
    "tower-service",
    "dynamic-service",
]
default-features = false

[dev-dependencies.mutants]
version = "0.0.3"
default-features = false

[dev-dependencies.ohno]
version = "0.3.1"
features = ["app-err"]
default-features = false

[dev-dependencies.opentelemetry]
version = "0.31.0"
features = ["metrics"]
default-features = false

[dev-dependencies.opentelemetry-stdout]
version = "0.31.0"
features = [
    "metrics",
    "logs",
]
default-features = false

[dev-dependencies.opentelemetry_sdk]
version = "0.31.0"
features = [
    "metrics",
    "testing",
    "experimental_metrics_custom_reader",
]
default-features = false

[dev-dependencies.rstest]
version = "0.26"
default-features = false

[dev-dependencies.serde]
version = "1.0.228"
features = [
    "std",
    "derive",
]
default-features = false

[dev-dependencies.serde_json]
version = "1.0.145"
default-features = false

[dev-dependencies.static_assertions]
version = "1.1.0"
default-features = false

[dev-dependencies.tick]
version = "0.2.1"
features = [
    "test-util",
    "tokio",
]
default-features = false

[dev-dependencies.tokio]
version = "1.48.0"
features = [
    "rt",
    "macros",
]
default-features = false

[dev-dependencies.tower]
version = "0.5.2"
features = ["util"]
default-features = false

[dev-dependencies.tower-service]
version = "0.3.3"
default-features = false

[dev-dependencies.tracing]
version = "0.1.41"
default-features = false

[dev-dependencies.tracing-subscriber]
version = "0.3.20"
features = [
    "fmt",
    "std",
]
default-features = false

[lints.clippy]
allow_attributes = "warn"
allow_attributes_without_reason = "warn"
as_pointer_underscore = "warn"
assertions_on_result_states = "warn"
clone_on_ref_ptr = "warn"
deref_by_slicing = "warn"
disallowed_script_idents = "warn"
empty_drop = "warn"
empty_enum_variants_with_brackets = "warn"
empty_structs_with_brackets = "warn"
fn_to_numeric_cast_any = "warn"
if_then_some_else_none = "warn"
map_err_ignore = "warn"
missing_const_for_fn = "allow"
multiple_crate_versions = "allow"
multiple_unsafe_ops_per_block = "warn"
option_if_let_else = "allow"
panic = "warn"
redundant_pub_crate = "allow"
redundant_type_annotations = "warn"
renamed_function_params = "warn"
semicolon_outside_block = "warn"
should_panic_without_expect = "allow"
significant_drop_tightening = "allow"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unneeded_field_pattern = "warn"
unused_result_ok = "warn"
unwrap_used = "warn"
wildcard_imports = "allow"

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

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

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

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

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

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

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

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

[lints.rust]
ambiguous_negative_literals = "warn"
missing_debug_implementations = "warn"
missing_docs = "warn"
redundant_imports = "warn"
redundant_lifetimes = "warn"
trivial_numeric_casts = "warn"
unsafe_op_in_unsafe_fn = "warn"
unused_lifetimes = "warn"

[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = ["cfg(coverage,coverage_nightly)"]

[lints.rustdoc]
missing_crate_level_docs = "warn"
unescaped_backticks = "warn"
