[−][src]Crate finchers
A combinator library for building asynchronous HTTP services.
The concept and design was highly inspired by finch
.
Features
- Asynchronous handling powerd by futures and Tokio
- Building an HTTP service by combining the primitive components
- Type-safe routing without (unstable) procedural macros
Example
use finchers::prelude::*; use finchers::endpoint::syntax::path; let get_post = path!(@get "/<u64>") .map(|id: u64| format!("GET: id={}", id)); let create_post = path!(@post "/") .and(endpoints::body::text()) .map(|data: String| format!("POST: body={}", data)); let endpoint = path!("/posts") .and(get_post.or(create_post)); izanami::Server::bind_tcp(&"127.0.0.1:4000".parse()?)? .start(endpoint.into_service())
Modules
action | Definition of |
endpoint | Components for constructing |
endpoints | Built-in endpoints. |
error | Error primitives. |
output | Components for constructing HTTP responses. |
prelude | A prelude for crates using the |
service | The components for using the implementor of |
test | The basic facilities for testing endpoints. |
util |
Macros
path | A macro for creating an endpoint that matches to the specific HTTP path. |