pub fn register_for_messages<F: FnOnce() -> !>(
    grant: SendPort<Pktsnip<Shared>, { _ }>,
    nettype: gnrc_nettype_t,
    demux_ctx: u32,
    f: F
) -> !
Available on riot_module_gnrc and crate feature with_msg_v2 only.
Expand description

Set up a netreg for a particular kind of messages

§Roadmap

It might be convenient for this to return at some point (in case of short-lived network services). Deregistration could be done and everything returned alright – but the grant would still be lost. This could be mitigated by accepting a ’static PktsnipPort or a clonable version thereof – not that anything could still be recombined after that, but at least it could be used once more (with the risk that messages from the old registration arrive in the new one, which is wrong correctness-wise but safe because it’ll still be a pointer to a pktsnip).