Skip to main content

Module util

Module util 

Source
Expand description

Small cross-cutting helpers used by multiple macro modules.

Functionsยง

extract_cfg_attrs ๐Ÿ”’
Extract #[cfg(...)] attributes from a list of attributes.
r_wrapper_raw_literal ๐Ÿ”’
Build a TokenStream containing a raw string literal from an R wrapper string.
raw_string_hashes ๐Ÿ”’
How many # a raw string literal holding s needs: one more than the longest run of # that follows a " in s.
resolve_self ๐Ÿ”’
Rewrites a leading Self in path to type_ident: a path an attribute names (#[r_data(get = "Self::f")], fallback = "Self::f") is called from a free function the macro emits outside any impl, where Self means nothing.
source_location_doc ๐Ÿ”’
Format a human-readable source location note from a syntax span.