Crate ijson[][src]

Expand description

This crate offers a replacement for serde-json’s Value type, which is significantly more memory efficient.

As a ballpark figure, it will typically use half as much memory as serde-json when deserializing a value and the memory footprint of cloning a value is more than 7x smaller.

The primary type exposed by this crate is the IValue type. It is guaranteed to be pointer-sized and has a niche (so Option<IValue> is also guaranteed to be pointer-sized).

Cargo features:

  • ctor A global string cache is used when interning strings. This cache is normally initialized lazily on first use. Enabling the ctor feature will cause it to be eagerly initialized on startup. There is no performance benefit to this, but it can help avoid false positives from tools like mockalloc which try to detect memory leaks during tests.

Re-exports

pub use array::IArray;
pub use number::INumber;
pub use object::IObject;
pub use string::IString;

Modules

Functionality relating to the JSON array type

Functionality relating to the JSON number type

Functionality relating to the JSON object type

Functionality relating to the JSON string type

Macros

Construct an IValue using familiar JSON syntax.

Structs

A proxy type which imitates a &mut bool.

Stores an arbitrary JSON value.

Enums

Enum returned by IValue::destructure to allow matching on the type of an owned IValue.

Enum returned by IValue::destructure_mut to allow matching on the type of a mutable reference to an IValue.

Enum returned by IValue::destructure_ref to allow matching on the type of a reference to an IValue.

Enum which distinguishes the six JSON types.

Traits

Trait which abstracts over the various number and string types which can be used to index into an IValue.

Functions

Converts an IValue to an arbitrary type using that type’s serde::Deserialize implementation.

Converts an arbitrary type to an IValue using that type’s serde::Serialize implementation.