litl-val 0.2.0

A memory efficient representation of JSON values
Documentation
use ordered_float::NotNan;

use super::{
    key_e::KeyE,
    map::Map,
    slim_boxed_slice::{SlimBoxedSlice, SlimBoxedString},
    tiny_string::TinyString,
    val::Val,
};

#[derive(Debug, PartialEq, Eq)]
pub enum ValE {
    Null,
    Bool(bool),
    Number(NotNan<f64>),
    ShortString(TinyString),
    LongString(SlimBoxedString),
    Array(SlimBoxedSlice<Val>),
    Object(Map),
}

impl ValE {
    #[inline]
    pub fn string(s: String) -> Self {
        KeyE::string(s).into()
    }

    #[inline]
    pub fn str(s: &str) -> Self {
        KeyE::str(s).into()
    }
}