azalia_serde/
lib.rs

1// 🐻‍❄️🪚 azalia: Noelware's Rust commons library.
2// Copyright (c) 2024-2025 Noelware, LLC. <team@noelware.org>
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files (the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in all
12// copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20// SOFTWARE.
21
22//! # 🐻‍❄️🪚 `azalia-serde`
23//! The **azalia-serde** crate provides blanket `serde` implementations for crates that don't expose any. This
24//! uses Cargo's crate features to explicitly enable which implementations you need, rather than adding them all
25//! at once.
26//!
27//! We only provide implementations to Rust types that are most used by us, so we will probably reject most
28//! requests to add more types other than the ones listed.
29//!
30//! ## Usage
31//! ### `tracing::Level` (requires `tracing` feature)
32//! ```
33//! use serde::{Serialize, Deserialize};
34//!
35//! #[derive(Serialize, Deserialize)]
36//! struct MyStruct {
37//!     #[serde(with = "azalia_serde::tracing")]
38//!     level: tracing::Level,
39//! }
40//! ```
41//!
42//! ### `aws_types::types::Region` (requires `aws` feature)
43//! ```
44//! use serde::{Serialize, Deserialize};
45//!
46//! #[derive(Serialize, Deserialize)]
47//! struct MyStruct {
48//!     #[serde(with = "azalia_serde::aws::region")]
49//!     region: aws_types::region::Region
50//! }
51// ```
52#![doc(html_logo_url = "https://cdn.floofy.dev/images/trans.png")]
53#![doc(html_favicon_url = "https://cdn.floofy.dev/images/trans.png")]
54#![cfg_attr(any(noeldoc, docsrs), feature(doc_cfg))]
55
56#[cfg(feature = "tracing")]
57#[cfg_attr(any(docsrs, noeldoc), doc(cfg(feature = "tracing")))]
58pub mod tracing;
59
60#[cfg(feature = "aws")]
61#[cfg_attr(any(docsrs, noeldoc), doc(cfg(feature = "aws")))]
62pub mod aws;
63
64#[cfg(feature = "s3")]
65#[cfg_attr(any(docsrs, noeldoc), doc(cfg(feature = "s3")))]
66pub mod s3;