Skip to main content

Module selector

Module selector 

Source
Expand description

Selecting #[traceable] functions by name/key, using exact match, or * pattern match.

Name/key is either:

  • module_path!() + "::" + fn_name
  • the macro’s name argument

§Patterns

* matches any sequence of characters. It acts as a wildcard.

my_app::domain::db::*   matches  my_app::domain::db::users::insert
                        matches  my_app::domain::db::query
                        does NOT match  my_app::domain::db
*::db::*                matches  any db function, in any crate or module
*                       matches  everything

§Typos are errors, empty patterns are warnings

An exact selector that matches nothing is almost certainly a typo, so resolve fails (UnknownKeys) and callers apply nothing. A pattern that matches nothing is only reported (Selection::unmatched_patterns).

Structs§

Selection
Result of a selection (match of a list of selectors).
UnknownKeys
Exact selectors that match no #[traceable] function in this binary.

Functions§

is_pattern
Whether selector is a pattern (contains *) rather than an exact key.
matches
Whether pattern matches key.
resolve
Resolve selectors: