This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[allow(dead_code)] | |
// BASIC STRUCTURES | |
// ================ | |
pub type Result<T> = ::std::result::Result<T,Error>; | |
#[derive(Debug,Copy,Clone,Eq,PartialEq)] | |
pub enum Reason { | |
NegativeMapLength, | |
OutOfRange, | |
UnknownReason |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate iron; | |
use std::sync::{Arc,Weak,RwLock}; | |
use iron::prelude::*; | |
use iron::{Listening,status}; | |
use std::ops::Drop ; | |
use std::net::ToSocketAddrs; | |
pub struct State { | |
pub whatever : String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate iron; | |
use std::sync::mpsc::* ; | |
use iron::prelude::*; | |
use iron::{Listening,status}; | |
fn main() { | |
let (tx,rx) = channel() ; | |
let handler = move |request: &mut Request| { | |
let tx = tx.clone(); | |
tx.send(5i32); |