cratestack-codec-json
JSON codec for CrateStack HTTP transport.
Overview
cratestack-codec-json exposes JsonCodec, a zero-state implementation of the CoolCodec trait built on serde_json. It is the right choice for human-readable interop and browser clients that do not negotiate CBOR.
Installation
[]
= "0.2.2"
Usage
use JsonCodec;
use CoolCodec;
let codec = JsonCodec;
let bytes = codec.encode?;
let value: = codec.decode?;
assert_eq!;
With generated routes
let router = model_router;
With the Rust client
use ;
let base_url = parse?;
let client = new;
See Also
- Transport Architecture
cratestack-codec-cbor— CBOR codec, preferred for production internal traffic
License
MIT