Visitar URL original
rustpython_derive - Rust
Skip to main content

Crate rustpython_derive

Crate rustpython_derive 

Source

Macros§

py_compile
py_freeze

Attribute Macros§

pyclass
The attribute can be applied either to a struct, trait, or impl.
pyexception
Helper macro to define Exception types. More-or-less is an alias to pyclass macro. A /// comment on the exception type is its docstring and overrides the stored documentation. Use // for developer notes.
pymodule
This attribute must be applied to an inline module. It defines a Python module in the form of a module_def function in the module; this has to be used in a add_native_module to properly register the module. Additionally, this macro defines ‘MODULE_NAME’ and ‘DOC’ in the module. A /// comment on the module is its docstring and overrides the stored module documentation. #[pyfunction] works the same way: its /// comment is the function docstring and overrides the stored function documentation. Use // for developer notes.
pystruct_sequence
Attribute macro for defining Python struct sequence types.
pystruct_sequence_data
Attribute macro for struct sequence Data structs.

Derive Macros§

FromArgs
Derive FromArgs for a struct whose fields are Python arguments.
PyPayload
Traverse
use on struct with named fields like struct A{x:PyRef<B>, y:PyRef<C>} to impl Traverse for datatype.