chore: initial draft of proc macros
This commit is contained in:
11
python-utils-macros/Cargo.toml
Normal file
11
python-utils-macros/Cargo.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "python-utils-macros"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
license.workspace = true
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
python-utils-macros-impl = { path = "../python-utils-macros-impl" }
|
||||
6
python-utils-macros/src/lib.rs
Normal file
6
python-utils-macros/src/lib.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
use proc_macro::proc_macro_derive;
|
||||
|
||||
#[proc_macro_derive(PyFromStr)]
|
||||
pub fn py_from_str(input: TokenStream) -> TokenStream {
|
||||
python_utils_macros_impl::py_from_str(input.into()).into()
|
||||
}
|
||||
Reference in New Issue
Block a user