zasa

Crates.iozasa
lib.rszasa
version
sourcesrc
created_at2024-11-06 19:30:03.781734
updated_at2024-12-10 17:10:35.276695
descriptionSimple JSON parser with no dependencies
homepagehttps://codeberg.org/micropanda123/zasa
repositoryhttps://codeberg.org/micropanda123/zasa
max_upload_size
id1438708
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(MicroPanda123)

documentation

README

Żasą

License: OQL

It's just own json parser writen only in rust, with 0 external dependencies, as part of my "No dependncies" series of projects.

Usage

Easiest way to use this library is to use it with Normalize macro, however it's still pretty unstable, but it works for basic stuff. Currently it supports String, f64 and bool types

use zasa::parser::Parser;
use zasa::value::normalize;
use zasa::Normalize;

#[derive(Debug, Normalize)]
struct Example {
  name: String,
  size: f64,
  active: bool
}

fn main() {
    let json_string = "{\"name\": \"test\", \"size\": 45.0, \"active\": true}";
    let parsed = Parser::new(json_string.chars()).parse().unwrap();
    let normalized: Example = normalize(parsed).unwrap();
    dbg!(normalized);
}

it will result in

normalized = Example {
  name: "test",
  size: 45.0,
  active: true,
}
Commit count: 0

cargo fmt