rustful Rust 的 RESTful 框架开源项目

我要开发同款
匿名用户2014年10月16日
107阅读

技术信息

开源地址
https://github.com/Ogeon/rustful
授权协议
MIT

作品详情

rustful是Rust编程语言的一个RESTful框架,主要目的是创建一个简单、轻量级的HTTP服务应用基础。基于无状态结构,根据路径和HTTP方法映射到响应处理器。

示例代码:

//Iclude rustful_macros durig sytax phase to be able to use the macros#![feature(phase)]#[phase(plugi)]exter crate rustful_macros;exter crate rustful;exter crate http;use rustful::{Server, Request, Respose};use http::method::Get;///Our hadler fuctiof hadler(request: Request, respose: &mut Respose) {    //Sed somethig ice to the user    try_sed!(respose, "Hello, user! It looks like this server works fie." while "sedig hello");}f mai() {    let server = Server::ew(8080, router!{"/" => Get: hadler});    //Start the server. All code beyod this poit is ureachable    server.ru();}

功能介绍

rustful 是 Rust 编程语言的一个 RESTful 框架,主要目的是创建一个简单、轻量级的 HTTP 服务应用基础。基于无状态结构,根据路径和 HTTP 方法映射到响应处理器。 示例代...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论