{"id":14987995,"url":"https://github.com/apache/openwhisk-runtime-rust","last_synced_at":"2025-10-19T12:30:23.046Z","repository":{"id":38781056,"uuid":"173112450","full_name":"apache/openwhisk-runtime-rust","owner":"apache","description":"Apache OpenWhisk Runtime Rust supports Apache OpenWhisk functions written in Rust","archived":false,"fork":false,"pushed_at":"2024-09-24T14:22:11.000Z","size":189,"stargazers_count":26,"open_issues_count":0,"forks_count":18,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-01-30T10:34:06.697Z","etag":null,"topics":["apache","cloud","docker","faas","functions","functions-as-a-service","openwhisk","openwhisk-runtime","rust","serverless","serverless-architectures","serverless-functions"],"latest_commit_sha":null,"homepage":"https://openwhisk.apache.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-28T12:57:28.000Z","updated_at":"2024-09-24T14:22:19.000Z","dependencies_parsed_at":"2024-09-19T22:01:10.701Z","dependency_job_id":null,"html_url":"https://github.com/apache/openwhisk-runtime-rust","commit_stats":{"total_commits":53,"total_committers":9,"mean_commits":5.888888888888889,"dds":0.4339622641509434,"last_synced_commit":"2bed1c4c7699861bd868e0ae53b3776a16f667cd"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-runtime-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-runtime-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-runtime-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-runtime-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/openwhisk-runtime-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237125517,"owners_count":19259298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","cloud","docker","faas","functions","functions-as-a-service","openwhisk","openwhisk-runtime","rust","serverless","serverless-architectures","serverless-functions"],"created_at":"2024-09-24T14:15:55.806Z","updated_at":"2025-10-19T12:30:22.695Z","avatar_url":"https://github.com/apache.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n--\u003e\n# Apache OpenWhisk Runtime for Rust\n\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Continuous Integration](https://github.com/apache/openwhisk-runtime-rust/actions/workflows/ci.yaml/badge.svg)](https://github.com/apache/openwhisk-runtime-rust/actions/workflows/ci.yaml)\n\n### Give it a try today\nTo use as a Docker action:\n\n```\nwsk action update myAction my_action.rs --docker openwhisk/action-rust-v1.34\n```\n\nThe file `my_action.rs` looks like:\n\n```\nextern crate serde_json;\n\nuse serde_derive::{Deserialize, Serialize};\nuse serde_json::{Error, Value};\n\n#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]\nstruct Input {\n    #[serde(default = \"stranger\")]\n    name: String,\n}\n\n#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]\nstruct Output {\n    body: String,\n}\n\nfn stranger() -\u003e String {\n    \"stranger\".to_string()\n}\n\npub fn main(args: Value) -\u003e Result\u003cValue, Error\u003e {\n    let input: Input = serde_json::from_value(args)?;\n    let output = Output {\n        body: format!(\"Hello, {}\", input.name),\n    };\n    serde_json::to_value(output)\n}\n```\n\nThe action is mainly composed by a `main` function that accepts a JSON `serdes Value` as input and returns a `Result` including a JSON `serde Value`.\n\nFor the return result, not only support `A JSON serde Value` but also support `Array serde Value`\n\nSo a simple `hello array` funtion would be:\n\n```rust\nextern crate serde_json;\n\nuse serde_derive::{Deserialize, Serialize};\nuse serde_json::{Error, Value};\n\n\npub fn main(args: Value) -\u003e Result\u003cValue, Error\u003e {\n    let output = [\"a\", \"b\"];\n    serde_json::to_value(output)\n}\n```\n\nAnd support array result for sequence action as well, the first action's array result can be used as next action's input parameter.\n\nSo the function can be:\n\n```rust\nextern crate serde_json;\n\nuse serde_derive::{Deserialize, Serialize};\nuse serde_json::{Error, Value};\n\n\npub fn main(args: Value) -\u003e Result\u003cValue, Error\u003e {\n    let inputParam = args.as_array();\n    let defaultOutput = [\"c\", \"d\"];\n    match inputParam {\n        None =\u003e serde_json::to_value(defaultOutput),\n        Some(x) =\u003e serde_json::to_value(x),\n    }\n}\n```\n### Managing dependencies\n\nIf your action needs external dependencies, you need to provide a zip file including your source, and your cargo file with all your dependencies. The folder structure is the following:\n```\n|- Cargo.toml\n|- src\n    |- lib.rs\n```\nHere is an example of a `Cargo.toml` file\n```\n[package]\nname = \"actions\"\nversion = \"0.1.0\"\nauthors = [\"John Doe \u003cjohn@doe.domain\u003e\"]\nedition = \"2018\"\n\n[dependencies]\nserde_json = \"1.0\"\nserde = \"1.0\"\nserde_derive = \"1.0\"\n```\nOnce you have all your code zipped in a file with the showed folder structure you can generate your action with the following command:\n```\nwsk action create yourAction /full_path_to/yourCode.zip --docker openwhisk/action-rust-v1.34\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fopenwhisk-runtime-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fopenwhisk-runtime-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fopenwhisk-runtime-rust/lists"}