Skip to main content

api_bones/serde/
mod.rs

1//! Serde helper modules for common API wire-format patterns.
2//!
3//! Each module is designed to be used with `#[serde(with = "...")]`.
4//!
5//! | Module          | Use case                                               |
6//! |-----------------|--------------------------------------------------------|
7//! | [`json_string`] | Value ↔ stringified JSON (`"{\"k\":\"v\"}"`)           |
8//! | [`base64_bytes`]| `Vec<u8>` ↔ Base64 string (standard / URL-safe)        |
9//! | [`timestamp`]   | `DateTime<Utc>` from epoch or ISO 8601, as RFC 3339    |
10//! | [`maybe_string`]| String-or-number coerced to a target type              |
11
12pub mod json_string;
13
14#[cfg(feature = "base64")]
15pub mod base64_bytes;
16
17#[cfg(feature = "chrono")]
18pub mod timestamp;
19
20pub mod maybe_string;