mason-rs

Crates.iomason-rs
lib.rsmason-rs
version0.4.0
created_at2025-08-01 16:33:06.525113+00
updated_at2025-08-28 10:05:01.526552+00
descriptionA rust implementation of MASON, a JSON-like object notation.
homepage
repositoryhttps://github.com/Emilinya/mason-rs
max_upload_size
id1777085
size153,203
(Emilinya)

documentation

README

Tests

mason-rs: MASON implementation for rust

This is a rust implementation of MASON, a JSON-like object notation.

API

MASON data can be deserialized to a Rust data structure using

pub fn from_reader<'de, T, R>(reader: R) -> Result<T>
where
    T: Deserialize<'de>,
    R: Read + 'de;

There are also two alternate functions for common use cases:

pub fn from_slice<'de, T: Deserialize<'de>>(bytes: &'de [u8]) -> Result<T>;

pub fn from_str<'de, T: Deserialize<'de>>(string: &'de str) -> Result<T>;

A Rust data structure can be serialized to MASON using

pub fn to_writer<T: Serialize, W: Write>(value: &T, writer: &mut W) -> Result<()>;

See the documentation for more info.

Running tests

To run tests, run cargo test or make check. This will download the MASON test suite and run it against this implementation.

Commit count: 20

cargo fmt