Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/therustmonk/json_macro
[DEPRECATED] Pure json macro for rust_serialize (use `serde` instead)
https://github.com/therustmonk/json_macro
Last synced: 2 days ago
JSON representation
[DEPRECATED] Pure json macro for rust_serialize (use `serde` instead)
- Host: GitHub
- URL: https://github.com/therustmonk/json_macro
- Owner: therustmonk
- Created: 2015-12-07T08:30:18.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-12T08:22:05.000Z (about 9 years ago)
- Last Synced: 2025-01-02T21:12:35.993Z (6 days ago)
- Language: Rust
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json_macro
Macro for rust_serialize crate realized with standard macro_rule (no needs compiler features).
## Dependencies
Add this to your `Cargo.toml`:
```toml
[dependencies]
json_macro = "*"
```and this to your crate root:
```rust
#[macro_use]
extern crate json_macro;
```## Usage
Use macro this way:
```rust
let s = json!("string");
let f = json!(3.1f64);
let a = json!([1,2,3,4,5]);
let o = json!({
"one" => 1,
"sub" => (json!({
"two" => 2
}))
});
```