0x0177b11f / faas-rust-template

An OpenFaaS of-watchdog template written in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

faas-rust-template

Docker Docker Repository on Quay

An OpenFaaS of-watchdog template written in Rust.

Features

  • use rust 1.41.1
  • use hyper 0.13
  • use async function
  • enable all tokio features
  • enable lto

Use template

$ faas template pull https://github.com/0x0177b11f/faas-rust-template
$ faas new --list
Languages available as templates:
- rust

Function

use hyper::{Body, Request, Response};
use std::convert::Infallible;

const PHRASE: &str = "Hello, World!";

pub async fn handle(_: Request<Body>) -> Result<Response<Body>, Infallible> {
    Ok(Response::new(PHRASE.into()))
}

// Returns:
// Hello, World!

About

An OpenFaaS of-watchdog template written in Rust.

License:MIT License


Languages

Language:Dockerfile 54.6%Language:Rust 45.4%