百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

rust-aws-lambda

> 编程语言
开源

支持在 AWS Lambda 上运行 Rust 程序

318 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

支持在 AWS Lambda 上运行 Rust 程序

Rust on AWS Lambda

UPDATE 30/11/2018: AWS have released an official runtime for Rust (announcement).

We recommend that you use the official runtime instead. You can still use the events crate, which has moved to LegNeato/aws-lambda-events.


This repository contains multiple crates that make it possible to run programs written in Rust directly as functions in AWS Lambda, while keeping a low footprint with regards to memory consumption, bundle size, and start-up speed. Website | Getting Started

Example

The start function will launch a runtime which will listen for messages from the lambda environment, and call a handler function every time the lambda is invoked. This handler function can be async, as the runtime itself is based on top of futures and tokio.

// [dependencies]
// aws_lambda = { git = "https://github.com/srijs/rust-aws-lambda" }
extern crate aws_lambda as lambda;

fn main() {
    // start the runtime, and return a greeting every time we are invoked
    lambda::start(|()| Ok("Hello ƛ!"))
}

Blogposts

  • Running Rust natively in AWS Lambda and testing it locally by @bernardobelchior shows how to use the gateway integration to build and deploy an image resizing function (repo).

  • Parsing logs 230x faster with Rust by @indirect talks about using the events integration to parse 500GB of logs per day (repo).

Comparison to other projects

AWS Lambda does not officially support Rust. To enable using Rust with lambda, great projects such as rust-crowbar and serverless-rust were created. They leverage Rust's C interoperability to "embed" Rust code into lambda supported language runtimes (in this case Python and Node.js respectively).

This project forgoes embedding and instead leverages lambda's official Go support. With Go, lambda runs a standard Linux binary containing a server and then sends it gob-encoded messages via rpc. This project reimplements all that machinery in Rust, using rust-gob for gob support and a custom tokio server runtime. Lambda does not care that the Linux binary it runs is written in Rust rather than Go as long as they behave the same.

Due to the no-overhead method of adding Rust support, a project deployed to lambda using this runtime should match (and might possibly exceed) the performance of a similar project written in Go.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言