Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Simple Rust serverless functions demonstrating basic HTTP handling and performance benchmarks.
Rust Hello World is a Vercel starter template that demonstrates how to build and deploy Rust serverless functions, with four endpoints covering JSON responses, streaming output, and CPU-bound performance benchmarks.
Rust Hello World is a starter template published by Vercel that shows how to write serverless functions in Rust. It takes a Rust project structured with an api directory and a Cargo.toml that defines multiple binary targets, and compiles those into serverless functions deployed on Vercel's platform. The template includes four runnable endpoints — api/hello for a basic JSON response, api/streaming for a streaming response, and api/realistic-math-bench plus api/slower-bench for performance benchmarking. It lives in the Vercel examples repository, which is publicly available on GitHub and has over 5,000 stars across the whole examples collection.
api/streaming endpoint demonstrates how to return a streaming HTTP response from a Rust serverless function, which is useful for long-lived connections or large payloads.api/realistic-math-bench and api/slower-bench provide CPU-bound tasks so you can measure Rust's execution speed on Vercel's serverless infrastructure.vc dev to test the functions locally; the page notes this requires the Rust toolchain to be installed on your machine.api directory plus multiple binaries in Cargo.toml — so you can see exactly how to structure a Rust serverless deployment.api/hello to build a minimal JSON API in Rust with no framework dependencies.api/streaming endpoint to implement server-sent events, live logs, or other chunked response patterns in Rust.Clone the Vercel examples repository and change into the rust/hello-world directory, then install Rust via the official rustup script if you don't already have it. After the toolchain is ready, run vc dev to launch a local development server that serves the endpoints. To go live, either use the one-click deploy URL or push the project to Vercel through the CLI.
No. The endpoints are plain Rust handlers that return JSON or streaming responses directly, with no framework such as Axum. If you prefer a framework, Vercel offers a related template called rust-axum that integrates the Axum web stack.
The template includes four endpoints: api/hello returns a basic JSON response, api/streaming demonstrates streaming responses, and api/realistic-math-bench along with api/slower-bench run CPU-bound performance benchmarks. Each endpoint maps to a separate binary in Cargo.toml.
Clone the repository, navigate to the rust/hello-world folder, and install Rust with the rustup script if it is missing. Then use the Vercel CLI command vc dev to serve the functions on a local development server. The template page states that the Rust toolchain is required for local testing.
