addr = "127.0.0.1:8000"; let server = Server::http(&addr) .unwrap(); println!("Listening at {}", addr); for request in server.incoming_requests() { let response = Response::from_string("Hello World\n"); request.respond(response); } }
let some_number : &u32 = get_me_a_number(); println!("The number is {}", some_number); } fn get_me_a_number() -> &u32 { let numbers = vec![1, 2, 3]; // ⚠ ERROR &numbers[2] //^^^^^^^ borrowed value // does not live long enough }
the required "business logic". JS classes are defined through macros: declare_types!( class JsBigInt for BigInt { init(cx) { /* ... */ } method toIntString(cx) { /* ... */ } } ) See: BigInts with Neon and num
Example https://www.meetup.com/MadRust/ Reddit, users forum WebAssembly: Rust and WebAssembly WG (check the !) wasm-pack (check the !) wasm-bindgen (check the !) Native addons, Neon: neon-bindings Web development, async I/O Are we web yet? Network Services WG We love "newbies"