format-ende-json

Crates.ioformat-ende-json
lib.rsformat-ende-json
version0.1.1
created_at2025-09-22 13:25:25.864409+00
updated_at2025-09-22 17:55:36.335485+00
descriptionformat-ende implementation for the JSON file format, based on serde_json
homepage
repositoryhttps://codeberg.org/CoffeJunkStudio/format-ende
max_upload_size
id1850027
size7,412
(dezajno)

documentation

README

JSON format for format-ende

This crate provides an implementation of the format-ende traits for the JSON format based on the serde_json crate.

Example

use format_ende::FormatEncoder;
use format_ende::FormatDecoder;
use format_ende_json::JsonFormat;

use std::io::Cursor;

let mut format = JsonFormat::new();
format.pretty = true; // Enable pretty printing

let mut buf: Vec<u8> = Vec::new();
let value = vec![
    String::from("foo"),
    String::from("bar"),
    String::from("baz")
];

// Encode the value to JSON
format.encode(&mut buf, &value).unwrap();

// Decode the value back from JSON
let decoded: Vec<String> = format.decode(Cursor::new(buf)).unwrap();

assert_eq!(decoded, value);
Commit count: 0

cargo fmt