Rename serde_impl to serde.
This commit is contained in:
parent
bd5ff457d2
commit
b789c319e7
@ -79,8 +79,6 @@ mod parser;
|
|||||||
pub mod plugin;
|
pub mod plugin;
|
||||||
mod result;
|
mod result;
|
||||||
mod scope;
|
mod scope;
|
||||||
#[cfg(feature = "serde")]
|
|
||||||
mod serde_impl;
|
|
||||||
mod stdlib;
|
mod stdlib;
|
||||||
mod syntax;
|
mod syntax;
|
||||||
mod token;
|
mod token;
|
||||||
@ -168,13 +166,8 @@ pub use module::ModuleResolver;
|
|||||||
#[cfg(not(feature = "no_module"))]
|
#[cfg(not(feature = "no_module"))]
|
||||||
pub use module::resolvers as module_resolvers;
|
pub use module::resolvers as module_resolvers;
|
||||||
|
|
||||||
/// _(SERDE)_ Serialization and deserialization support for [`serde`](https://crates.io/crates/serde).
|
|
||||||
/// Exported under the `serde` feature.
|
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
pub mod serde {
|
pub mod serde;
|
||||||
pub use super::serde_impl::de::from_dynamic;
|
|
||||||
pub use super::serde_impl::ser::to_dynamic;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(feature = "no_optimize"))]
|
#[cfg(not(feature = "no_optimize"))]
|
||||||
pub use optimize::OptimizationLevel;
|
pub use optimize::OptimizationLevel;
|
||||||
|
@ -17,7 +17,7 @@ use crate::Map;
|
|||||||
///
|
///
|
||||||
/// The reference is necessary because the deserialized type may hold references
|
/// The reference is necessary because the deserialized type may hold references
|
||||||
/// (especially `&str`) to the source [`Dynamic`][crate::Dynamic].
|
/// (especially `&str`) to the source [`Dynamic`][crate::Dynamic].
|
||||||
pub struct DynamicDeserializer<'a> {
|
struct DynamicDeserializer<'a> {
|
||||||
value: &'a Dynamic,
|
value: &'a Dynamic,
|
||||||
}
|
}
|
||||||
|
|
14
src/serde/mod.rs
Normal file
14
src/serde/mod.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
//! _(SERDE)_ Serialization and deserialization support for [`serde`](https://crates.io/crates/serde).
|
||||||
|
//! Exported under the `serde` feature only.
|
||||||
|
|
||||||
|
mod de;
|
||||||
|
mod deserialize;
|
||||||
|
mod ser;
|
||||||
|
mod serialize;
|
||||||
|
mod str;
|
||||||
|
|
||||||
|
#[cfg(feature = "metadata")]
|
||||||
|
mod metadata;
|
||||||
|
|
||||||
|
pub use de::from_dynamic;
|
||||||
|
pub use ser::to_dynamic;
|
@ -14,7 +14,7 @@ use crate::Array;
|
|||||||
use crate::Map;
|
use crate::Map;
|
||||||
|
|
||||||
/// Serializer for [`Dynamic`][crate::Dynamic] which is kept as a reference.
|
/// Serializer for [`Dynamic`][crate::Dynamic] which is kept as a reference.
|
||||||
pub struct DynamicSerializer {
|
struct DynamicSerializer {
|
||||||
/// Buffer to hold a temporary key.
|
/// Buffer to hold a temporary key.
|
||||||
_key: Dynamic,
|
_key: Dynamic,
|
||||||
/// Buffer to hold a temporary value.
|
/// Buffer to hold a temporary value.
|
||||||
@ -639,7 +639,7 @@ impl SerializeStruct for DynamicSerializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(feature = "no_object", feature = "no_index")))]
|
#[cfg(not(any(feature = "no_object", feature = "no_index")))]
|
||||||
pub struct TupleVariantSerializer {
|
struct TupleVariantSerializer {
|
||||||
variant: &'static str,
|
variant: &'static str,
|
||||||
array: Array,
|
array: Array,
|
||||||
}
|
}
|
||||||
@ -664,7 +664,7 @@ impl serde::ser::SerializeTupleVariant for TupleVariantSerializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "no_object"))]
|
#[cfg(not(feature = "no_object"))]
|
||||||
pub struct StructVariantSerializer {
|
struct StructVariantSerializer {
|
||||||
variant: &'static str,
|
variant: &'static str,
|
||||||
map: Map,
|
map: Map,
|
||||||
}
|
}
|
@ -1,10 +0,0 @@
|
|||||||
//! Helper module defining serialization/deserialization support for [`serde`].
|
|
||||||
|
|
||||||
pub mod de;
|
|
||||||
mod deserialize;
|
|
||||||
pub mod ser;
|
|
||||||
mod serialize;
|
|
||||||
mod str;
|
|
||||||
|
|
||||||
#[cfg(feature = "metadata")]
|
|
||||||
pub mod metadata;
|
|
Loading…
x
Reference in New Issue
Block a user