Fixes/upgrades

This commit is contained in:
2026-07-30 21:12:29 -04:00
parent e00b3a177e
commit 9494549861
13 changed files with 823 additions and 60 deletions

View File

@@ -0,0 +1,35 @@
"""Pydantic to Rust type conversion.
Reads Pydantic class declarations and emits matching serde-derived Rust
structs, so one declaration backs both tiers.
What it covers: scalars, `Optional`, `list`/`set`/`tuple`, `dict`, string
`Literal`s, unions, NewTypes, references to other models and enums, and
Pydantic defaults. What it does not: methods, validators, generics, memory
layout, and enum bodies — an enum lowers to a reference by name, leaving its
declaration to the caller.
"""
from pydantic_to_rust.emit import emit_rust_struct
from pydantic_to_rust.idents import to_rust_ident, to_rust_variant_ident
from pydantic_to_rust.ir import (
DefaultValue,
FieldDecl,
ModelDecl,
Primitive,
TypeShape,
)
from pydantic_to_rust.walker import lower_annotation, walk_pydantic_model
__all__ = [
"DefaultValue",
"FieldDecl",
"ModelDecl",
"Primitive",
"TypeShape",
"emit_rust_struct",
"lower_annotation",
"to_rust_ident",
"to_rust_variant_ident",
"walk_pydantic_model",
]