Skip to content

Instantly share code, notes, and snippets.

View Cobrand's full-sized avatar

Cobrand

  • Nantes
View GitHub Profile
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);
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
}
@Cobrand
Cobrand / map_2d_iter_mut.rs
Created June 30, 2016 14:52
Trouble for creating an iterator over a 2d map : example file
#[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