INNER CODE UNIT · Rust
ast
stjude-rust-labs/sprocket · crates/sprocket-py-macros/src/lib.rs:282
pub fn ast(args_stream: TokenStream, item_stream: TokenStream) -> TokenStream {
ast::ast(args_stream.into(), item_stream.into())
.unwrap_or_else(Error::into_compile_error)
.into()
}
/// Makes AST element methods available in Python.
///
/// When added to an `impl` block, this attribute will make all **public**
/// functions available in Python. If an public function is annotated with
/// `#[skip]`, it will not be processed by this macro. These functions must
/// return a type that implements `IntoPyObject`. If a function returns an `impl
/// Iterator<Item = T>` where `T: IntoPyObject`, it will be adapted by the
/// attribute to return a list in Python.
///
/// As a general rule of thumb, add this attribute to the main `impl` block for
/// any type annotated with [`#[ast]`](ast).
///