Skip to main content

facet_format/
lib.rs

1#![deny(unsafe_code)]
2#![deny(missing_docs, rustdoc::broken_intra_doc_links)]
3#![allow(unused_macros)]
4
5//! Prototype types for the format deserializer.
6
7/// Trace-level logging macro that forwards to `tracing::trace!` when the `tracing` feature is enabled.
8///
9/// When the `tracing` feature is disabled, this expands to nothing.
10#[cfg(feature = "tracing")]
11macro_rules! trace {
12    ($($arg:tt)*) => {
13        ::tracing::trace!($($arg)*)
14    };
15}
16
17/// Trace-level logging macro (no-op when `tracing` feature is disabled).
18#[cfg(not(feature = "tracing"))]
19macro_rules! trace {
20    ($($arg:tt)*) => {};
21}
22
23/// Debug-level logging macro that forwards to `tracing::debug!` when the `tracing` feature is enabled.
24///
25/// When the `tracing` feature is disabled, this expands to nothing.
26#[cfg(feature = "tracing")]
27#[allow(unused_macros)]
28macro_rules! debug {
29    ($($arg:tt)*) => {
30        ::tracing::debug!($($arg)*)
31    };
32}
33
34/// Debug-level logging macro (no-op when `tracing` feature is disabled).
35#[cfg(not(feature = "tracing"))]
36#[allow(unused_macros)]
37macro_rules! debug {
38    ($($arg:tt)*) => {};
39}
40
41#[allow(unused_imports)]
42pub(crate) use debug;
43#[allow(unused_imports)]
44pub(crate) use trace;
45
46mod deserializer;
47mod event;
48mod evidence;
49mod parser;
50mod serializer;
51mod solver;
52mod type_plan_cache;
53mod visitor;
54
55pub use deserializer::{
56    DeserializeError, DeserializeErrorKind, FormatDeserializer, MetaSource, ParseError, SpanGuard,
57};
58pub use event::{
59    ContainerKind, FieldKey, FieldLocationHint, ParseEvent, ParseEventKind, ScalarValue, ValueMeta,
60    ValueMetaBuilder, ValueTypeHint,
61};
62pub use evidence::FieldEvidence;
63pub use parser::{EnumVariantHint, FormatParser, SavePoint, ScalarTypeHint};
64pub use serializer::{
65    DynamicValueEncoding, DynamicValueTag, EnumVariantEncoding, FieldOrdering, FormatSerializer,
66    MapEncoding, SerializeError, StructFieldMode, serialize_root, serialize_value_with_shape,
67};
68pub use solver::{SolveOutcome, SolveVariantError, solve_variant};
69pub use visitor::{FieldMatch, StructFieldTracker};