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.
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.
pystruct_sequence
Attribute macro for defining Python struct sequence types.
pystruct_sequence_data
Attribute macro for struct sequence Data structs.

Derive Macros§

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