No description
Find a file
2025-02-11 22:36:04 +01:00
zasa version bump 2 2025-01-26 00:32:45 +01:00
zasa-core more edits and stuff 2025-02-11 22:36:04 +01:00
zasa-derive clippy 2025-01-23 07:32:24 +01:00
.gitignore Prepare workspace for proc-macro 2024-11-18 13:52:19 +01:00
Cargo.lock more edits and stuff 2025-02-11 22:36:04 +01:00
Cargo.toml derive now works also on pub elements of struct 2024-12-07 14:22:17 +01:00
LICENSE.txt Prepare workspace for proc-macro 2024-11-18 13:52:19 +01:00
README.md some docs 2024-12-07 15:15:08 +01:00

Ż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,
}