Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
REsource EndPoint (REEP)
Provides a ResourceEndpointBuilder
witch allows you to
easily build RESTlike resource based endpoints.
This implementation uses static constraints to assure that e.g. if a resource replacing handler is called the query options are parsed/valid, the resource id in the url is parsed/valid and the body is parsed/valid.
All parsed elements (option(=queryparameter), id and body) will be put into the request extensions typemap
using the statically provided types. Note that it is assured that the BodyParser
creates a resource witch's id type is the same as that of the parsed id.
State of the Project
- basic functionality is working
- documentation exists for all parts but could be improved (e.g. examples)
- minimal http/options hander are generated if not provided
- head request have to be handled manually (HttpHead ResourceMethod)
- some default/generic option/id/body implementations exist in additional repos
- no TravisCI integration yet
- not published on crates.io yet
- no tests yet expect a working example
Utils / Preimplementated Parts
There are some existing reusable implementations for some of the reep::types
-Traits:
- generic BodyParser using json/rustc_serialize
- String Id with (optional) serialisation support
- optionParser using urlencoded query parsing
Example
Due to some problems when placing the example under /examples
a full example can be found in the reep-example repo. Additionally here is a schematic usage example:
let ep = ResourceEndpointBuilder::new(optionParser, bodyParser)
.create(ironHandlerForCreating)
.list(ironHandlerForListing)
.delete(ironHanderForDeleting)
.replace(ironHandlerForReplacing)
.get(ironHanderForGeting)
.finalize();
app.mount("/users", ep);
License
MIT