Skip to content

Instantly share code, notes, and snippets.

View teburd's full-sized avatar

Tom Burdick teburd

View GitHub Profile
@teburd
teburd / cowboy_http_rest.erl
Created July 14, 2011 05:20
Cowboy HTTP REST
-module(cowboy_http_rest).
-export([]).
-record(state, {
res,
res_state,
content_types_provided,
content_type_accepted
}).
@teburd
teburd / playground.rs
Created August 3, 2019 17:32 — forked from rust-play/playground.rs
Code shared from the Rust Playground
struct MsgReader<'a> {
tx: &'a RoTransaction,
buf: &'a [u8];
buf_reader: BufReader<&'a [u8]>,
msg: capnp::message::Reader<'a, OwnedSegments>,
}
fn get<'a>(tx: &'a RoTransaction, id: u64) -> MsgReader<'a>
{
let buf = tx.get(id);