coap_handler_implementations

Function new_dispatcher

Source
pub fn new_dispatcher() -> impl Handler + Reporting
Expand description

Start building a tree of sub-resources

While technically this just returns a handler that returns 4.04 unconditionally, it also implements HandlerBuilder, and thus can be used like this:

use coap_handler_implementations::*;
let handler = new_dispatcher()
    .at(&["dev", "name"], SimpleRendered::new_typed_str("Demo program", Some(0)))
    .at(&["dev", "version"], SimpleRendered::new_typed_str("0.8.15", Some(0)))
    .with_wkc()
    ;