feat: FromPyFromStr and ToStrToPy macros YAY

This commit is contained in:
J / Jacob Babich
2026-07-09 01:35:49 -04:00
parent c637ad2d76
commit 9a9cefee37
25 changed files with 343 additions and 394 deletions

View File

@@ -1,17 +1,5 @@
use proc_macro2::TokenStream;
use quote::quote;
use syn::{DeriveInput, parse_macro_input};
mod from_py_from_str;
mod to_str_to_py;
pub fn py_from_str(input: TokenStream) -> TokenStream {
let derive_input: DeriveInput = parse_macro_input!(input);
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
let expanded = quote! {
impl #impl_generics MyTrait for #name #ty_generics #where_clause {
// ...
}
};
expanded
}
pub use from_py_from_str::FromPyFromStr;
pub use to_str_to_py::ToStrToPy;