pub fn scope<'env, F, R>(callback: F) -> Rwhere
F: for<'id> FnOnce(&mut RegistrationScope<'env, 'id>) -> R,
Available on
riot_module_gcoap
only.Expand description
Give the caller a way of registering Gcoap handlers into the global Gcoap registry inside a callback. When the callback terminates, the registered handlers are deregistered again, theoretically allowing the registration of non-’static handlers.
As there is currently no way to unregister handlers, this function panics when the callback terminates. (Otherwise, it’d return the callback’s return value).