launchdarkly-server-sdk 3.2.0

LaunchDarkly Server-Side SDK
Documentation
[package]
name = "launchdarkly-server-sdk"
description = "LaunchDarkly Server-Side SDK"
version = "3.2.0"
authors = ["LaunchDarkly"]
edition = "2021"
rust-version = "1.95.0"  # MSRV
license = "Apache-2.0"
homepage = "https://docs.launchdarkly.com/sdk/server-side/rust"
repository = "https://github.com/launchdarkly/rust-server-sdk"
keywords = ["launchdarkly", "launchdarkly-sdk", "feature-flags", "feature-toggles"]
exclude = [
    "coverage.sh"
]

[package.metadata.docs.rs]
features = []

[dependencies]
chrono = "0.4.19"
crossbeam-channel = "0.5.1"
data-encoding = "2.3.2"
eventsource-client = { version = "0.17.0" }
launchdarkly-sdk-transport = { version = "0.1.0" }
futures = "0.3.12"
log = "0.4.14"
lru = { version = "0.16.3", default-features = false }
# Pulled without default features so that the float-roundtrip feature below is what decides
# whether the evaluation engine parses floats the way Go does.
launchdarkly-server-sdk-evaluation = { version = "2.2.0", default-features = false }
serde = { version = "1.0.132", features = ["derive"] }
serde_json = { version = "1.0.73" }
thiserror = "2.0"
tokio = { version = "1.17.0", features = ["rt-multi-thread"] }
parking_lot = "0.12.0"
tokio-stream = { version = "0.1.8", features = ["sync"] }
moka = { version = "0.12.1", features = ["sync"] }
uuid = {version = "1.2.2", features = ["v4"] }
http = "1.0"
bytes = "1.11"
bitflags = "2.4"
rand = "0.9"
flate2 = { version = "1.0.35", optional = true }
aws-lc-rs = { version = "1.14.1", optional = true }
openssl = { version = "0.10.75", optional = true }

[dev-dependencies]
maplit = "1.0.1"
env_logger = "0.10.0"
serde_json = { version = "1.0.73", features = ["preserve_order"] } # for deterministic JSON testing
tokio = { version = "1.17.0", features = ["macros", "time"] }
test-case = "3.2.1"
mockito = "1.2.0"
assert-json-diff = "2.0.2"
async-std = "1.12.0"
reqwest = { version = "0.12.4", features = ["json"] }
testing_logger = "0.1.1"

[features]
default = [
    "hyper-rustls-native-roots",
    "crypto-aws-lc-rs",
    "event-compression",
    "float-roundtrip"
]

crypto-aws-lc-rs = ["dep:aws-lc-rs"]
crypto-openssl = ["dep:openssl"]

hyper = [
    "launchdarkly-sdk-transport/hyper",
    "eventsource-client/hyper"
]
hyper-rustls-native-roots = [
    "hyper",
    "launchdarkly-sdk-transport/hyper-rustls-native-roots",
    "eventsource-client/hyper-rustls-native-roots"
]
hyper-rustls-webpki-roots = [
    "hyper",
    "launchdarkly-sdk-transport/hyper-rustls-webpki-roots",
    "eventsource-client/hyper-rustls-webpki-roots"
]
native-tls = [
    "hyper",
    "launchdarkly-sdk-transport/native-tls",
    "eventsource-client/native-tls"
]

event-compression = ["flate2"]

# Parse fractional JSON numbers with serde_json's correctly-rounded float parser, so that
# numeric flag values and numeric context attributes deserialize to the same f64 that Go's
# encoding/json produces. This keeps evaluations consistent with the other LaunchDarkly SDKs
# and is why the feature is enabled by default.
#
# Disabling it makes serde_json use its faster best-effort parser, which can land one unit in
# the last place away from the correctly-rounded value. Note that Cargo feature unification is
# additive and global, so this feature is still on if any other crate in the dependency graph
# asks for serde_json/float_roundtrip.
float-roundtrip = [
    "serde_json/float_roundtrip",
    "launchdarkly-server-sdk-evaluation/float-roundtrip"
]

[[example]]
name = "print_flags"
required-features = ["hyper-rustls-native-roots"]

[[example]]
name = "progress"
required-features = ["hyper-rustls-native-roots"]