Function do_with_in::genericDefaultHandlers
source · pub fn genericDefaultHandlers<'a, T>(
) -> HashMap<String, (Box<&'a (dyn Fn(Configuration<T>, Variables<'_, T>, Option<TokenStream>, TokenStream) -> Result<(Variables<'_, T>, TokenStream), (Variables<'_, T>, TokenStream)> + 'static)>, Option<TokenStream>)>where
T: 'static + StartMarker + Clone,
Expand description
This function generates the default handler set.
Currently, the actually useful handlers consist of:
Invoke as | Defined by | Note |
---|---|---|
if | ifHandler | Use as $(if test { true branch } { false branch }) . The test will often be either a variable that has been set elsewhere or a $(logic ...) block. |
let | letHandler | Internally, a wrapper around assignmentInternalHandler; do not interpolate on definition or use |
var | varHandler | Internally, a wrapper around assignmentInternalHandler; interpolate on definition and on use |
concat | concatHandler | |
naiveStringifier | naiveStringifierHandler | |
string_to_ident | string_to_identHandler | |
arithmetic | arithmeticHandler | You have to specify the type of the number eg i8, usize, f64 |
logic | logicHandler | Sublanguage: nesting with parenthesis; logic ops ⌜&⌝, ⌜|⌝, ⌜^⌝, ⌜=⌝, unary ⌜!⌝, ⌜true⌝, ⌜false⌝; numeric comparisons with numbers ⌜>⌝, ⌜>=⌝, ⌜=⌝, ⌜<=⌝, ⌜<⌝, ⌜!=⌝ |
mk | mkHandler | A simple way to define new handlers at the use site |
quote | quote | In the lisp sense; renders the argument inert |
unquote | unquote | In the lisp sense; renders the argument ert |
run | run | |
array | arrayHandler | This handler has a bunch of subcommands and options; it is where most of the functionality for dealing with the representation we use of arrays is. |
import | importHandler | Basic file inclusion; path must be specified by quoted segments; special unquoted identier Base is used for the crate root; errors in included file will point at import statement |
withSigil | withSigilHandler | |
marker | markerHandler | This handler is for embedding data in one invocation of do_with_in! in a way that can be used in other invocations. |
runMarkers | runMarkersHandler | This handler loads data into the environment from other invocations of do_with_in!. |