Macro newstr::use_required [−][src]
macro_rules! use_required { () => { ... }; (regex) => { ... }; }
Expand description
This macro expands to the set of use statements required by a consumer of either
is_valid_newstring
or
from_str_newstring
macros. This can be valuable over time
if the implementationof these macros take on additional dependencies.
The macro takes a single, optional, parameter regex
which will also include the necessary
dependencies used by the regex_is_valid
macro.
Examples
use_required!(); is_valid_newstring!(NotEmpty, |s: &str| !s.is_empty());
use_required!(regex); regex_is_valid!(r"[0-9]+", is_valid_integer);