Commit Briefs

99beb4a538 Murilo Ijanc

add ToJson/FromJson traits and json_struct! macro (main)


610939e0b1 Murilo Ijanc

initial import of jackson, a single-file JSON library


Branches

Tags

This repository contains no tags

Tree

.gitignorecommits | blame
.rustfmt.tomlcommits | blame
LICENSEcommits | blame
Makefilecommits | blame
README.mdcommits | blame
bench/
jackson.rscommits | blame
tests/

README.md

jackson - parse and generate JSON documents
============================================
jackson is a minimal, zero-dependency, single-file JSON parser and
generator written in Rust.  It is meant to be dropped into another
project's source tree, or linked as a plain rlib.


Requirements
------------
In order to build jackson you need rustc (edition 2024).


Installation
------------
There are two ways to use jackson in another Rust project.

Drop-in source.  Copy jackson.rs into your project and declare it as
a module:

    mod jackson;
    use jackson::Value;

Linked rlib.  Build the library with make(1) and pass it to rustc:

    $ make
    $ rustc --extern jackson=build/libjackson.rlib -L build main.rs


Example
-------
Parse a JSON document:

    use jackson::Value;

    let v: Value = r#"{"name":"jackson"}"#.parse()?;

Generate a JSON document:

    println!("{}", v.stringify()?);


Download
--------
    got clone ssh://anon@ijanc.org/jackson
    git clone https://git.ijanc.org/jackson.git
    git clone https://git.sr.ht/~ijanc/jackson
    git clone https://github.com/jackson.git


License
-------
ISC - see LICENSE.