// This will POST a body of
// `{"lang": "rust", "body": "json"}`
#[derive(Serialize)]
struct Body<'a> {
lang: &'a str,
body: &'a str,
}
let client = re...
// This will POST a body of
// `{"lang": "rust", "body": "json"}`
#[derive(Serialize)]
struct Body<'a> {
lang: &'a str,
body: &'a str,
}
let client = re...
In order to setup a project we need to install the nightly build of Rust and add the WebAssembly target. For an improved workflow we also install the CLI tools wasm-pack and wasm-gc.
Install:
bre...
fn main() {
let a = [10, 20, 30, 40, 50, 60];
for element in a.iter() {
println!("The value is:{}", element)
}
}
fn main() {
for element in (1..4).rev() {
...
fn main() {
let a = [10, 20, 30, 40, 50, 60];
for element in a.iter() {
println!("The value is:{}", element)
}
}
fn main() {
for element in (1..4).rev() {
...