Available on crates.io

Laminate

Data, shaped layer by layer.

lam·i·nate /ˈlaməˌnāt/ verb

To bond layers of material together, each adding strength and structure to the whole. In software: to progressively shape raw, unstructured data into typed, validated values — layer by layer, at whatever depth your application requires.

The missing data layer for Rust. Progressive type coercion, automatic format detection, and fault-tolerant deserialization — built on serde, not against it.

MIT OR Apache-2.0 · Rust 1.85+ · 3 core dependencies

Install

[dependencies]
laminate = { version = "0.1", features = ["full"] }

Real-world data is messy. Laminate handles it.

use laminate::FlexValue;

let data = FlexValue::from_json(
    r#"{"port": "8080", "debug": "true"}"#
)?;

let port: u16 = data.extract("port")?;   // "8080" → 8080
let debug: bool = data.extract("debug")?; // "true" → true
THE ORIGIN
“I would love to see this explored in a different library specifically geared toward fault-tolerant partially successful deserialization.”

— serde maintainer, issue #464 (2017)

Laminate is that library. It doesn't replace serde — it builds on top of it, adding the progressive coercion and graceful degradation that serde deliberately doesn't provide.

What's in the box

Progressive Coercion

Four levels of strictness — from exact type matching to best-effort conversion. You choose how forgiving your pipeline should be.

Learn more →

Automatic Type Detection

guess_type() identifies integers, dates, currencies, emails, UUIDs, IBANs, credit cards, and 15+ other types from raw strings — with confidence scores.

Learn more →

Graduated Diagnostics

Every coercion reports what happened, the risk level (Info/Warning/Risky), and how to tighten it. Audit your data pipeline without breaking it.

Learn more →

Domain Packs

Built-in parsers for dates (15+ formats), currencies (19 symbols), medical lab values (30+ analytes), identifiers (12 types with checksums), and units.

Learn more →

Provider Normalization

Parse and normalize responses from Anthropic, OpenAI, and Ollama into a unified structure. Stream SSE events incrementally.

Learn more →

Derive Macro

#[derive(Laminate)] with #[laminate(coerce)], #[laminate(default)], #[laminate(overflow)] — struct shaping with compile-time safety.

Learn more →
71,915
Test cases
100%
Pass rate
8M+
Fuzz runs
3
Core dependencies
MIT / Apache-2.0
License