serde_spanned/
lib.rs

1//! A [serde]-compatible spanned Value
2//!
3//! This allows capturing the location, in bytes, for a value in the original parsed document for
4//! compatible deserializers.
5//!
6//! [serde]: https://serde.rs/
7
8#![cfg_attr(docsrs, feature(doc_auto_cfg))]
9#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
10#![warn(missing_docs)]
11#![warn(clippy::std_instead_of_core)]
12#![warn(clippy::std_instead_of_alloc)]
13// Makes rustc abort compilation if there are any unsafe blocks in the crate.
14// Presence of this annotation is picked up by tools such as cargo-geiger
15// and lets them ensure that there is indeed no unsafe code as opposed to
16// something they couldn't detect (e.g. unsafe added via macro expansion, etc).
17#![forbid(unsafe_code)]
18#![warn(clippy::print_stderr)]
19#![warn(clippy::print_stdout)]
20
21#[cfg(feature = "alloc")]
22#[allow(unused_extern_crates)]
23extern crate alloc;
24
25mod spanned;
26pub use crate::spanned::Spanned;
27#[cfg(feature = "serde")]
28pub mod de;
29
30#[doc = include_str!("../README.md")]
31#[cfg(doctest)]
32pub struct ReadmeDoctests;