austenite

Crates.ioaustenite
lib.rsaustenite
version0.0.1
sourcesrc
created_at2015-02-09 18:18:38.088155
updated_at2015-12-11 23:57:49.028558
descriptionHTTP endpoint library for header processing and content negotiation
homepage
repositoryhttps://github.com/hugoduncan/austenite
max_upload_size
id1366
size63,214
Hugo Duncan (hugoduncan)

documentation

http://hugoduncan.github.io/austenite/austenite/index.html

README

Austenite

A library for building Iron handlers that implements HTTP header handling and content negotiation.

A port of Clojure's Liberator library, itself inspired by Erlang's webmachine.

Install

Add austenite = "*" to your Cargo.toml dependencies.

Usage

struct GetOkContent;
resource_handler!(GetOkContent);

impl Resource for GetOkContent {
    fn handle_ok(&self, req: &Request, resp: &mut Response)
               -> IronResult<Response>
    {
      resp.set_mut((status::Ok, "hello"));
      Ok(Response::new())
    }
}

…
Iron::new(Resource).listen((address,0u16));
…

License

Copyright 2015 Hugo Duncan

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Commit count: 16

cargo fmt