1#![doc(html_logo_url = "https://raw.githubusercontent.com/mitsuhiko/deser/main/artwork/logo.svg")]
9#![cfg_attr(docsrs, feature(doc_cfg))]
10#![cfg_attr(not(any(feature = "std", test)), no_std)]
11
12extern crate alloc;
13
14#[macro_use]
15mod macros;
16mod event;
17
18pub mod adapters;
19pub mod de;
20mod error;
21pub mod ext;
22pub mod hints;
23#[cfg(feature = "io")]
24pub mod io;
25pub mod ser;
26pub mod stream;
27
28mod bytes_format;
29mod extensions;
30mod foreign_impls;
31mod position;
32mod source;
33mod state;
34mod std_impls;
35#[cfg(feature = "std")]
36mod std_only_impls;
37mod sync;
38mod text;
39
40pub use self::bytes_format::BytesFormat;
41pub use self::error::{Error, ErrorAttachment, ErrorContext, ErrorKind};
42pub use self::event::{Atom, Bytes, ContainerShape, Event, Implicit, ImplicitValue, Order};
43pub use self::extensions::EventData;
44pub use self::position::Position;
45pub use self::source::Source;
46pub use self::state::State;
47pub use self::text::Text;
48
49#[doc(no_inline)]
52pub use self::{de::Deserialize, ser::Serialize, stream::Streamed};
53
54#[cfg(feature = "derive")]
55pub mod derive;
56
57#[doc(hidden)]
60#[path = "format.rs"]
61pub mod __format;
62
63#[cfg(feature = "derive")]
67#[doc(hidden)]
68pub mod __derive {
69 pub use alloc::borrow::Cow;
70 pub use alloc::boxed::Box;
71 pub use alloc::string::String;
72 pub use alloc::vec::Vec;
73 pub use core::convert::Into;
74 pub use core::default::Default;
75 pub use core::marker::{PhantomData, Send, Sync};
76 pub use core::mem::replace;
77 pub use core::option::Option::{self, None, Some};
78 pub use core::primitive::{str, u8};
79 pub use core::result::Result::{Err, Ok};
80 pub use core::unreachable;
81 pub type Result<T> = core::result::Result<T, super::Error>;
82 pub type StrCow<'a> = Cow<'a, str>;
83
84 pub use crate::adapters::ser_impls::SerializeAsRef;
85 pub use crate::adapters::{DerivedDeserialize, DerivedSerialize};
86 pub use crate::de::atoms::{
87 atom_into, atom_into_handle, borrowed_atom_into, borrowed_atom_into_handle, field_update,
88 unit_struct,
89 };
90 pub use crate::de::enums::{
91 AdjacentlyTaggedSink, BoxedVariant, EnumKey, ExternallyTaggedSink, IgnoredContent,
92 IgnoredVariant, InternallyTaggedSink, OtherVariant, Tag, UnitEnum, UntaggedTry, Variant,
93 VariantMaker, Variants, atom_sink, unit_enum_atom_into, unit_enum_sink, untagged_atom,
94 untagged_borrowed_atom, untagged_fallback, untagged_handle,
95 };
96 pub use crate::de::fields::{
97 Collect, FieldKeySink, NextField, StructFields, StructFinish, StructInfo, StructSink,
98 StructUpdateSink, UpdateFields, collected_errors, missing_field, new_missing_field_error,
99 };
100 pub use crate::de::mapped::mapped;
101 pub use crate::de::recording::RecordBuf;
102 pub use crate::de::unknown::{unclaimed_keys, unknown_field};
103 pub use crate::de::update::UpdateTarget;
104 pub use crate::error::unknown_variant;
105 pub use crate::ser::begin::{
106 Begin, FIELDS_END, IndexedSeq, IndexedSeqEmitter, IndexedStruct, IndexedStructEmitter,
107 PlainSink, StructField, emit_plain_field,
108 };
109 pub use crate::ser::enums::{
110 EntrySer, FieldSer, FieldsSer, FlatFieldsSer, SeqSer, TaggedContent, TaggedNewtype,
111 UnitName, UnitVariants, begin_unit, describe_unit, serialize_unit, skipped_variant,
112 };
113 pub use crate::ser::flatten::FlattenedStruct;
114}