typeshift
typeshift provides a Zod-like parse workflow with idiomatic Rust types.
The struct or enum is the single source of truth. With one derive, you get:
SerializeDeserializeValidateJsonSchema
Install
[]
= "0.2"
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
#[derive(TypeShift)]supports structs and enums, including generics.- Unions are intentionally not supported.
More examples
cargo run -p typeshift --example basiccargo run -p typeshift --example enum_taggedcargo run -p typeshift --example generic_envelope