Thanks to the effort of Roberto Diaz who provided the actionloop in rust, I
built the Rust for OpenWhisk (ActionLoop powered, of course):
```
$ wsk action create hello-rust src/lib.rs --docker
actionloop/actionloop-rust-v1.32
ok: created action hello-rust
$ wsk action invoke hello-rust -r
{
"greeting": "Hello, stranger"
}
$ wsk action invoke hello-rust -r -p name Mike
{
"greeting": "Hello, Mike"
}
```
This is the rust hello world (probably it can be written better I am an
absolute beginner in Rust...):
```
extern crate serde_json;
use std::collections::HashMap;
use serde_json::Value;
pub fn main(args: HashMap<String, Value>) -> HashMap<String, Value> {
let name_opt = args.get("name");
let name = if name_opt.is_some() {
name_opt.unwrap().as_str().unwrap()
} else {
"stranger"
};
let mut out = HashMap::new();
out.insert("greeting".to_string(), Value::String(format!("Hello, {}",
name)));
out
}
```
Now we should add all the tests and provide the runtimes for integrating into
OpenWhisk...
--
Michele Sciabarra
[email protected]