deser-core 0.9.0

Core traits and types of deser, use the deser crate instead
Documentation
//! The core of [deser](https://docs.rs/deser).
//!
//! This crate is an implementation detail of deser, use the
//! [`deser`](https://docs.rs/deser) crate instead which re-exports
//! everything in here together with the derive macros.  The crates of the
//! data formats depend on this crate so that they can be compiled without
//! waiting for the derive macros.
#![doc(html_logo_url = "https://raw.githubusercontent.com/mitsuhiko/deser/main/artwork/logo.svg")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(not(any(feature = "std", test)), no_std)]

extern crate alloc;

#[macro_use]
mod macros;
mod event;

pub mod adapters;
pub mod de;
mod error;
pub mod ext;
pub mod hints;
#[cfg(feature = "io")]
pub mod io;
pub mod ser;
pub mod stream;

mod bytes_format;
mod extensions;
mod foreign_impls;
mod position;
mod source;
mod state;
mod std_impls;
#[cfg(feature = "std")]
mod std_only_impls;
mod sync;
mod text;

pub use self::bytes_format::BytesFormat;
pub use self::error::{Error, ErrorAttachment, ErrorContext, ErrorKind};
pub use self::event::{Atom, Bytes, ContainerShape, Event, Implicit, ImplicitValue, Order};
pub use self::extensions::EventData;
pub use self::position::Position;
pub use self::source::Source;
pub use self::state::State;
pub use self::text::Text;

// common re-exports

#[doc(no_inline)]
pub use self::{de::Deserialize, ser::Serialize, stream::Streamed};

#[cfg(feature = "derive")]
pub mod derive;

// Helpers for writing formats (float formatting, small copies).  Not
// public API.
#[doc(hidden)]
#[path = "format.rs"]
pub mod __format;

// Everything the code generated by the derive refers to.  Not public API.
// Standard library items are re-exported so that the generated code does
// not depend on what the names refer to where the derive is used.
#[cfg(feature = "derive")]
#[doc(hidden)]
pub mod __derive {
    pub use alloc::borrow::Cow;
    pub use alloc::boxed::Box;
    pub use alloc::string::String;
    pub use alloc::vec::Vec;
    pub use core::convert::Into;
    pub use core::default::Default;
    pub use core::marker::{PhantomData, Send, Sync};
    pub use core::mem::replace;
    pub use core::option::Option::{self, None, Some};
    pub use core::primitive::{str, u8};
    pub use core::result::Result::{Err, Ok};
    pub use core::unreachable;
    pub type Result<T> = core::result::Result<T, super::Error>;
    pub type StrCow<'a> = Cow<'a, str>;

    pub use crate::adapters::ser_impls::SerializeAsRef;
    pub use crate::adapters::{DerivedDeserialize, DerivedSerialize};
    pub use crate::de::atoms::{
        atom_into, atom_into_handle, borrowed_atom_into, borrowed_atom_into_handle, field_update,
        unit_struct,
    };
    pub use crate::de::enums::{
        AdjacentlyTaggedSink, BoxedVariant, EnumKey, ExternallyTaggedSink, IgnoredContent,
        IgnoredVariant, InternallyTaggedSink, OtherVariant, Tag, UnitEnum, UntaggedTry, Variant,
        VariantMaker, Variants, atom_sink, unit_enum_atom_into, unit_enum_sink, untagged_atom,
        untagged_borrowed_atom, untagged_fallback, untagged_handle,
    };
    pub use crate::de::fields::{
        Collect, FieldKeySink, NextField, StructFields, StructFinish, StructInfo, StructSink,
        StructUpdateSink, UpdateFields, collected_errors, missing_field, new_missing_field_error,
    };
    pub use crate::de::mapped::mapped;
    pub use crate::de::recording::RecordBuf;
    pub use crate::de::unknown::{unclaimed_keys, unknown_field};
    pub use crate::de::update::UpdateTarget;
    pub use crate::error::unknown_variant;
    pub use crate::ser::begin::{
        Begin, FIELDS_END, IndexedSeq, IndexedSeqEmitter, IndexedStruct, IndexedStructEmitter,
        PlainSink, StructField, emit_plain_field,
    };
    pub use crate::ser::enums::{
        EntrySer, FieldSer, FieldsSer, FlatFieldsSer, SeqSer, TaggedContent, TaggedNewtype,
        UnitName, UnitVariants, begin_unit, describe_unit, serialize_unit, skipped_variant,
    };
    pub use crate::ser::flatten::FlattenedStruct;
}