Rustic Hal

A simple library for serializing (and deserializing coming soon) resources following the HAL Spec

Clippy Linting Result Build Status

Usage

On stable rust (>= 1.15)

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;

[macro_use]

extern crate serdederive; extern crate serdejson;

use rustichal::*; use serdejson::to_string;

[derive(Serialize)]

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)); }

```

Documentation

see https://pduval.github.io/rustichal/rustichal/ for the cargo-doc pages.

Credits

This library is heavily inspired by (read copied from) the hal-rs library by Herman J. Radtke III.