Rust 的 RESTful 框架 rustful
- 授权协议: MIT
- 开发语言: Rust
- 操作系统: 跨平台
- 软件首页: https://github.com/Ogeon/rustful
- 软件文档: http://ogeon.github.io/rustful/doc/rustful/
软件介绍
rustful 是 Rust 编程语言的一个 RESTful 框架,主要目的是创建一个简单、轻量级的 HTTP 服务应用基础。基于无状态结构,根据路径和 HTTP 方法映射到响应处理器。
示例代码:
//Include rustful_macros during syntax phase to be able to use the macros
#![feature(phase)]
#[phase(plugin)]
extern crate rustful_macros;
extern crate rustful;
extern crate http;
use rustful::{Server, Request, Response};
use http::method::Get;
///Our handler function
fn handler(request: Request, response: &mut Response) {
//Send something nice to the user
try_send!(response, "Hello, user! It looks like this server works fine." while "sending hello");
}
fn main() {
let server = Server::new(8080, router!{"/" => Get: handler});
//Start the server. All code beyond this point is unreachable
server.run();
}
你也能看得懂的Python算法书
王硕,董文馨,张舒行,张洁 著 / 电子工业出版社 / 2018-11-1 / 59.00
编程的核心是算法,学习算法不仅能教会你解决问题的方法,而且还能为你今后的发展提供一种可能。 《你也能看得懂的Python算法书》面向算法初学者,首先介绍当下流程的编程语言Python,详细讲解Python语言中的变量和循序、分支、循环三大结构,以及列表和函数的使用,为之后学习算法打好基础。然后以通俗易懂的语言讲解双指针、哈希、深度优先、广度优先、回溯、贪心、动态规划和至短路径等经典算法。 ......一起来看看 《你也能看得懂的Python算法书》 这本书的介绍吧!
