typeshift
typeshift provides a Zod-like parse workflow with idiomatic Rust types.
The struct or enum is the single source of truth. With one attribute, you get:
SerializeDeserializeValidateJsonSchema
Install
[]
= "0.3"
Quick start
use typeshift;
API
parse_str<T: TypeShift>(&str) -> Result<T, TypeShiftError>to_json<T: TypeShift>(&T) -> Result<String, serde_json::Error>schema_json<T: TypeShift>() -> serde_json::Value
Notes
#[typeshift]supports structs and enums, including generics.- Unions are intentionally not supported.
#[derive(TypeShift)]is a legacy compatibility marker and does not generate impls.
More examples
cargo run -p typeshift --example basiccargo run -p typeshift --example enum_taggedcargo run -p typeshift --example generic_envelopecargo run -p typeshift --example full_flow