Skip to main content

Module util

Module util 

Source
Expand description

Helpers every macro built on this crate uses, ulo-macros included.

Functions§

check_factory_params
A factory’s parameters are injection points, read by type, so each needs its type written. Checked to report the error on the parameter rather than on a factory bound the closure fails as a whole.
combine
Every error in errors as one, so a single expansion reports all of them; None when empty.
wrap_async
|u: Ext<CurrentUser>| RoleGuard::require(u) becomes |u: Ext<CurrentUser>| async move { RoleGuard::require(u) }. An explicit return type moves onto a binding inside the block, since an async block cannot carry one. An enhancer attribute’s with entry, #[module]’s into lists and a gateway’s connect_guards and session_with share it, so a closure is written the same way in each.