Skip to main content

Crate easy_macros

Crate easy_macros 

Source

Re-exports§

pub use always_context_build;build

Macros§

all_syntax_casesall-syntax-cases
Generates exhaustive handler functions for traversing syn AST syntax trees.
context_helpers
Helper utilities for building procedural macros Creates a closure that generates context strings for error handling with automatic file and line information.
context_internal_helpers
Helper utilities for building procedural macros Macro used by context! macro in easy_macros_helpers crate
context_internal2_helpers
Helper utilities for building procedural macros Macro used by always_context attribute macro
fields_get_attributesattributes
fields_with_attributesattributes
get_attributesattributes
has_attributesattributes
parse_macro_input_helpers
Helper utilities for building procedural macros Adjusted version of syn’s parse_macro_input! macro for #[anyhow_result] procedural macro attribute.

Structs§

AttrWithUnknownattributes
Low-level attribute parser used internally by the attribute extraction macros.
TokensBuilder_helpers
Helper utilities for building procedural macros A builder for accumulating and formatting token streams in procedural macros.

Traits§

CompileErrorProvider_helpers
Helper utilities for building procedural macros Collect and provide error information for expr_error_wrap.

Functions§

expr_error_wrap_helpers
Helper utilities for building procedural macros Wraps an expression in a block that includes compile-time error messages.
find_crate_helpers
Helper utilities for building procedural macros Locates a crate in the current Cargo.toml and generates the appropriate path reference.
find_crate_list_helpers
Helper utilities for building procedural macros Attempts to find any of multiple crates, returning the path for the first one found.
indexed_name_helpers
Helper utilities for building procedural macros Generates a vector of identifiers by appending numeric indices to a base name.
readable_token_stream_helpers
Helper utilities for building procedural macros Formats a token stream string by removing unnecessary whitespace while preserving readability.
token_stream_to_consistent_string_helpers
Helper utilities for building procedural macros Converts a token stream to a consistent string representation without spaces.

Attribute Macros§

add_codeadd-code
This is handy for keeping docify-generated examples clean while still inserting setup/teardown or assertions for tests.
add_code_debugadd-code
always_contextalways-context
Automatically adds .with_context(context!()) to all ? operators that don’t already have context.
anyhow_resultanyhow-result
Enables procedural macros to return anyhow::Result<TokenStream> for ergonomic error handling.