coap-handler-implementations crate provides a few convenience, example or
reference implementations of the coap-handler interface.
They range from the generic “4.04
Not Found” responder up to a handler that creates a write formatter for GET-only resources,
and even provides block-wise transfer that.
The SimpleCBORWrapper enables the easy creation of serde_cbor based
resource implementations with GET, PUT and POST support in CBOR format.
HandlerBuilder implements crude static path based routing
that may suffice for some applications, and is also useful to get started quickly.
This code used to be part of coap-handler, but while the interface needs to stabilize fast (as incompatible changes there propagate to implementations), the implementations still need to develop fast (but it doesn’t hurt too much if one code part is using the old SimpleRenderable while another uses a newer NeverFound).
Version 0.1 is what was available in coap-handler (if Cargo allowed cyclic dependencies,
pub use this crate); users are encouraged to just use
A common mechanism in handlers is that handlers “consume” options. For example, the ForkingHandler built through HandlerBuilder::at “eats” the Uri-Path; likewise, an Accept-based dispatcher would consume the Accept option.
This allows the handlers themselves to check for any left-over critical options and fail if they can’t handle them – without the need to mask them out there assuming (without an actual check) that prior wrappers took care of them.
A resource that unconditionally responds 4.04 Not Found.
Wrapper for resource handlers that are implemented in terms of GETting, POSTing or PUTting objects in CBOR format.
Information a SimpleRenderable needs to carry from request to response.
Tagged-union container for ForkingHandler
Trait implemented by default on all handlers that lets the user stack them using a builder-like syntax.
A simple Handler trait that supports GET, POST and/or PUT on a data structure that supports serde.
A simplified Handler trait that can react to GET requests and will render to a fmt::Write object with blockwise backing.
Start building a tree of sub-resources