Skip to main content

Crate monty_macros

Crate monty_macros 

Source
Expand description

Procedural macros for the monty Python interpreter.

  • #[derive(FromArgs)] — ArgValues → typed struct (positional/kwarg dispatch, defaults, type coercion via FromValue, refcount cleanup).
  • #[derive(ToArgs)] — typed struct → host call arguments.

Generated code is internal to monty (FromArgs) and monty-types (ToArgs). See the crate README.md for usage and the docstrings on StructAttrs / FieldKind in from_args.rs for the full attribute surface.

Derive Macros§

FromArgs
Derive FromArgs::from_args. Each struct field becomes a Python parameter; the generated body parses an ArgValues and populates the struct, returning RunResult<Self>.
ToArgs
Projects a struct into host call arguments using #[from_args(...)] attributes. varargs fields contribute one positional argument per element.