Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changes/unreleased/added-20260629-144131.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: Added
body: |-
**`jiff` feature for `buffa-types`** (#264).
Adds conversions between the well-known types and [jiff](https://docs.rs/jiff):
`Timestamp` ↔ `jiff::Timestamp` and `Duration` ↔ `jiff::SignedDuration`. Gated
behind the new `jiff` Cargo feature and `no_std`-compatible (`jiff` is pulled
with `default-features = false` + `alloc`).
time: 2026-06-29T14:41:31.006126085+08:00
107 changes: 104 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ bytes = { version = "1", default-features = false }
# 0.4.31 fails to compile this crate's `chrono` feature, 0.4.34 succeeds.
chrono = { version = "0.4.34", default-features = false }
foldhash = { version = "0.1", default-features = false }
# `jiff` interop for `Timestamp` / `Duration` (the `buffa-types` `jiff`
# feature). Pulled with `default-features = false` + `alloc` so the conversions
# stay `no_std`; `buffa-types`' `std` feature layers `jiff/std` on top. MSRV
# 1.70 as of 0.2 — within buffa's pin.
jiff = { version = "0.2", default-features = false, features = ["alloc"] }
hashbrown = { version = "0.15", default-features = false, features = ["default-hasher"] }
once_cell = { version = "1", default-features = false }
rustversion = { version = "1" }
Expand Down
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ tasks:
- cargo check -p buffa --no-default-features --target thumbv7em-none-eabihf
- cargo check -p buffa-types --no-default-features
- cargo check -p buffa-types --no-default-features --features chrono
- cargo check -p buffa-types --no-default-features --features jiff
- cargo check -p buffa-descriptor --no-default-features
# ── Coverage ─────────────────────────────────────────────────────────

Expand Down
2 changes: 1 addition & 1 deletion buffa-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buffa = { workspace = true, features = ["std", "json", "text"] }
# generated with `generate_text(true)` and the pool decodes the WKT
# descriptors that need it.
buffa-descriptor = { workspace = true, features = ["reflect", "json", "std"] }
buffa-types = { workspace = true, features = ["json", "chrono"] }
buffa-types = { workspace = true, features = ["json", "chrono", "jiff"] }
# The SmolStr preset crate, used by the string_type fixtures and as the template
# for the crate-local newtypes in `reprs`.
buffa-smolstr = { workspace = true, features = ["serde"] }
Expand Down
7 changes: 6 additions & 1 deletion buffa-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["std"]
std = ["buffa/std", "thiserror/std", "serde?/std", "serde_json?/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`,
Expand All @@ -26,6 +26,10 @@ reflect = ["dep:buffa-descriptor", "buffa-descriptor/reflect", "buffa-descriptor
# 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 }
Expand All @@ -39,6 +43,7 @@ buffa-descriptor = { workspace = true, optional = true }
# `::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 }
Expand Down
Loading
Loading