A simple library for serializing (and deserializing coming soon) resources following the HAL Spec
Add the dependency to your Cargo.toml:
```toml
[dependencies] rustichal="0.2" serde="1.0" serdejson="1.0" serde_derive="1.0"
``` and to use:
```rust
extern crate rustic_hal; extern crate serde;
extern crate serdederive; extern crate serdejson;
use rustichal::*; use serdejson::to_string;
pub struct MyResource { pub test: String, }
fn main() { let mr = MyResource { test: "Hello, World!".tostring(), }; let halres = HalResource::new(mr).withlink("self", "/api/myresource/0"); println!("json representation: {:?}", tostring(&hal_res)); }
```
see https://pduval.github.io/rustichal/rustichal/ for the cargo-doc pages.
This library is heavily inspired by (read copied from) the hal-rs library by Herman J. Radtke III.