#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc = include_str!("../README.md")]
#![deny(missing_docs)]
#![cfg_attr(not(any(feature = "std", test)), no_std)]
#[cfg(feature = "alloc")]
extern crate alloc;
pub use core_json::*;
mod primitives;
mod float;
mod option;
mod sequences;
mod string;
#[cfg(feature = "alloc")]
mod boxed;
#[cfg(feature = "alloc")]
mod maps;
pub use float::JsonF64;
pub trait JsonDeserialize: Sized {
fn deserialize<'read, 'parent, B: Read<'read>, S: Stack>(
value: Value<'read, 'parent, B, S>,
) -> Result<Self, JsonError<'read, B, S>>;
}
pub trait JsonStructure: JsonDeserialize {
fn deserialize_structure<'read, B: Read<'read>, S: Stack>(
json: B,
) -> Result<Self, JsonError<'read, B, S>> {
let mut json = Deserializer::new(json)?;
let value = json.value()?;
Self::deserialize(value)
}
}
pub trait JsonSerialize {
fn serialize(&self) -> impl Iterator<Item = char>;
}