AI authored to showcase ironpad capabilities.
ironpad has a built-in Json display type that pretty-prints JSON with syntax highlighting. It's great for exploring API responses, configuration data, or any structured data.
The Json type wraps a serde_json::Value and renders it with color-coded keys, strings, numbers, and booleans.
{ "features": [ "wasm", "notebooks", "charts" ], "name": "ironpad", "stats": { "cells_compiled": 42, "is_awesome": true, "tests_passing": 190 }, "version": "0.1.0" }
You can create a Json value from a raw string using the standard str::parse() method or serde_json::from_str.
{ "page": null, "total": 3, "users": [ { "active": true, "id": 1, "name": "Alice" }, { "active": false, "id": 2, "name": "Bob" }, { "active": true, "id": 3, "name": "Charlie" } ] }
Combine Json with ironpad's HTTP helpers to fetch and display API responses beautifully.
{ "args": {}, "headers": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br, zstd", "Host": "httpbin.org", "Origin": "http://localhost:3111", "Priority": "u=1, i", "Referer": "http://localhost:3111/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "cross-site", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/145.0.7632.6 Safari/537.36", "X-Amzn-Trace-Id": "Root=1-6a7f6904-5c51e60678040b9f28d13416" }, "origin": "174.164.136.150", "url": "https://httpbin.org/get" }
You can also serialize your own Rust structs into Json for display. This is handy for inspecting complex data structures.
[ { "language": "Rust", "name": "ironpad", "stars": 128, "topics": [ "wasm", "notebook" ] }, { "language": "Rust", "name": "plotters", "stars": 4200, "topics": [ "visualization", "svg" ] } ]