Rust 的 RESTful 框架 rustful

码农软件 · 软件分类 · REST/RESTful项目 · 2019-03-11 06:44:22

软件介绍

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();
}

本文地址:https://codercto.com/soft/d/1084.html

Fortran 95/2003程序设计

Fortran 95/2003程序设计

中国电力出版社 / 2009-8 / 88.00元

Fortran是计算世界最早出现的高级程序设计语言之一,随着面向对象编程时代的到来,Fortran语言不仅保持了发展的步伐,而且继续在科学计算方面领先。《Fortran95/2003程序设计(第3版)》在第2~7章介绍了Fortan语言基础知识,为初学者提供入门学习资料;在第8~15章介绍了Fortran语言高级特性,为深入用好Fortran语言提供支持;在第16章讲述了Fortran语言面向对象......一起来看看 《Fortran 95/2003程序设计》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具