1 个不稳定版本
使用旧的Rust 2015
| 0.11.0 | 2018年5月14日 | 
|---|
#9 在 #finchers
在 4 个crate中使用
46KB
 1.5K  SLoC
finchers
finchers 是一个组合库,用于构建异步HTTP服务。
其概念和设计深受 finch 的启发。
特性
- 由futures和Tokio驱动的异步处理能力
- 通过组合原始组件来构建HTTP服务
- 无(不稳定)过程宏的类型安全路由
用法
将此项目添加到您的项目中的 Cargo.toml
[dependencies]
finchers = "0.14.0-dev"
示例
use finchers::{
    prelude::*,
    endpoint::syntax::path,
};
fn main() -> izanami::Result<()> {
    let endpoint = path!(@get "/greeting/<String>")
        .map(|name: String| {
            format!("Hello, {}!\n", name)
        });
    izanami::Server::build()
        .start(endpoint.into_service())
}
资源
贡献特性
- finchers-juniper- 基于- juniper的GraphQL集成支持
- finchers-tungstenite- 基于- tungstenite的WebSocket支持
- finchers-session:会话支持
- finchers-template:模板引擎支持
状态
| Travis CI | Codecov | 
|---|---|
许可证
本项目受以下许可证之一许可
- MIT许可证,(LICENSE-MIT 或 https://open-source.org.cn/licenses/MIT)
- Apache许可证,版本2.0 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
任选其一。
依赖项
~9MB
~155K SLoC