buffa-types 0.9.0

Protobuf well-known types for buffa
Documentation
[package]
name = "buffa-types"
description = "Protobuf well-known types for buffa"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true

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

[features]
default = ["std"]
std = ["buffa/std", "thiserror/std", "serde?/std", "serde_json?/std", "jiff?/std"]
json = ["dep:serde", "dep:serde_json", "buffa/json"]
arbitrary = ["dep:arbitrary", "buffa/arbitrary"]
# Runtime reflection for the WKT views (`impl ReflectMessage for TimestampView`,
# etc.) and owned types. Pulls `buffa-descriptor` and requires `std` (the
# embedded descriptor pool uses `std::sync::OnceLock`). Off by default so
# `no_std` consumers and those that don't reflect pay nothing.
reflect = ["dep:buffa-descriptor", "buffa-descriptor/reflect", "buffa-descriptor/std", "std"]
# Conversions between WKT `Timestamp` / `Duration` and `chrono::DateTime<Utc>` /
# `chrono::TimeDelta`. `no_std`-compatible.
chrono = ["dep:chrono"]
# Conversions between WKT `Timestamp` / `Duration` and `jiff::Timestamp` /
# `jiff::SignedDuration`. `no_std`-compatible (`jiff` is pulled with
# `default-features = false` + `alloc`); the `std` feature adds `jiff/std`.
jiff = ["dep:jiff"]

[dependencies]
arbitrary = { workspace = true, optional = true }
# `buffa/text` is zero-dep and the WKT generated code unconditionally impls
# `TextFormat` — enabled here so the checked-in src/generated/ always compiles.
buffa = { workspace = true, default-features = false, features = ["text"] }
# Optional: only when the `reflect` feature is on. The generated WKT reflect
# impls reference `::buffa_descriptor::reflect::*`.
buffa-descriptor = { workspace = true, optional = true }
# Generated `Any.value: Bytes` (via `bytes_fields` in gen_wkt_types) emits
# `::bytes::Bytes` paths, so the crate is referenced directly.
bytes = { workspace = true }
chrono = { workspace = true, optional = true }
jiff = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
thiserror = { workspace = true }

# No [build-dependencies]. WKT code is checked in at src/generated/ so
# consumers don't need protoc or the buffa-build/buffa-codegen toolchain.
# Regenerate with `task gen-wkt-types` if codegen output format changes.

[dev-dependencies]
criterion = "0.5"

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