fn cpu_dump<'a>(req: &mut Request, response: Response<'a>) -> MiddlewareResult<'a> {
	let id = req.param("id").parse::<i32>().ok().expect("unable to dump invalid cpu id");
	match req.extensions().get::<CpuDb>() {
		Some(cpuserv) => {
			let r_serv = cpuserv.read().unwrap();
			let cpu    = r_serv.database.get(&id).unwrap();

			response.send(format!("{}", cpu.state.js_dump()))
		},
		None => { response.send("did not find cpu serv") }
	}
}
/// POST /cpu/:id/dump
/// Dumps the CPUs current state to a JSON format.
/// This request does not modify the CPU state in any way.
POST /cpu/:id/dump
Dumps the CPUs current state to a JSON format.
This request does not modify the CPU state in any way.
POST / cpu / : id / dump Dumps the CPUs current state to a JSON format . This request does not modify the CPU state in any way .
fn cpu_dump<'a>(req: &mut Request, response: Response<'a>) -> MiddlewareResult<'a> {
	let id = req.param("id").parse::<i32>().ok().expect("unable to dump invalid cpu id");
	match req.extensions().get::<CpuDb>() {
		Some(cpuserv) => {
			let r_serv = cpuserv.read().unwrap();
			let cpu    = r_serv.database.get(&id).unwrap();
			response.send(format!("{}", cpu.state.js_dump()))
		},
		None => { response.send("did not find cpu serv") }
	}
}
fn cpu_dump < ' a > ( req : & mut Request , response : Response < ' a > ) -> MiddlewareResult < ' a > { let id = req . param ( " " ) . parse :: < i32 > ( ) . ok ( ) . expect ( " " ) ; match req . extensions ( ) . get :: < CpuDb > ( ) { Some ( cpuserv ) => { let r_serv = cpuserv . read ( ) . unwrap ( ) ; let cpu = r_serv . database . get ( & id ) . unwrap ( ) ; response . send ( format ! ( " " cpu state js_dump ( ) ) ) } , None => { response . send ( " " ) } } }
POST /cpu/:id/dump
Dumps the CPUs current state to a JSON format.
POST / cpu / : id / dump Dumps the CPUs current state to a JSON format .
req
&mut Request
response
Response<'a>