# cloudflare/workers-rs

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/cloudflare-workers-rs).**

3,337 stars · 375 forks · Rust · apache-2.0

## Links

- GitHub: https://github.com/cloudflare/workers-rs
- awesome-repositories: https://awesome-repositories.com/repository/cloudflare-workers-rs.md

## Topics

`cloudflare` `ffi` `rust` `serverless` `webassembly` `workers` `workers-rs`

## Description

The Cloudflare Workers Rust SDK is a toolchain and framework for building high-performance serverless functions using Rust. It compiles code into WebAssembly modules that execute within a sandboxed host environment at the edge.

The project provides a typed remote procedure call system for invoking functions across different worker instances and utilizes procedural macros for mapping these distributed interfaces. It uses trait-based bindings and standardized wrappers to provide type-safe access to platform services and web-standard request and response objects.

The SDK covers a broad range of edge capabilities, including HTTP middleware for request routing and WebSocket management, as well as asynchronous background processing via message queues. It integrates various storage primitives such as distributed key-value stores, R2 object storage, and D1 SQLite databases, alongside stateful coordination through durable objects. Additionally, it includes primitives for calling artificial intelligence models for text generation and data analysis.

## Tags

### DevOps & Infrastructure

- [Wasm Execution Engines](https://awesome-repositories.com/f/devops-infrastructure/container-runtimes/wasm-execution-engines.md) — Compiles Rust code into WebAssembly modules that execute within a high-performance sandboxed host environment.
- [Serverless Function Development](https://awesome-repositories.com/f/devops-infrastructure/serverless-function-development.md) — Provides a comprehensive SDK for writing and deploying high-performance serverless functions using Rust. ([source](https://cdn.jsdelivr.net/gh/cloudflare/workers-rs@main/README.md))
- [Distributed Edge Compute Platforms](https://awesome-repositories.com/f/devops-infrastructure/cloud-infrastructure/cloud-computing-serverless/edge-computing-platforms/distributed-edge-compute-platforms.md) — Provides a toolchain for deploying resource-constrained, isolated code execution with integrated storage at the edge.
- [Edge Request Processing](https://awesome-repositories.com/f/devops-infrastructure/edge-request-processing.md) — Executes application logic on a global network of edge servers to handle and route incoming web traffic.
- [Background Job Processing](https://awesome-repositories.com/f/devops-infrastructure/background-job-processing.md) — Enables asynchronous background task execution via message queues to decouple processing from the main request flow.
- [Message Queue Workers](https://awesome-repositories.com/f/devops-infrastructure/message-queue-workers.md) — Implements background processing components that consume and execute tasks from message queues. ([source](https://docs.rs/worker/0.8.5/worker/))
- [Cloudflare R2 Object Storages](https://awesome-repositories.com/f/devops-infrastructure/object-storage-providers/cloudflare-r2-object-storages.md) — Provides native integration for managing files and metadata within Cloudflare R2 object storage buckets. ([source](https://docs.rs/worker/latest/worker/))
- [Namespace-Based Dispatching](https://awesome-repositories.com/f/devops-infrastructure/worker-node-management/worker-groupings/dedicated-worker-routing/namespace-based-dispatching.md) — Dispatches events to multiple named workers within a namespace using a single binding implementation. ([source](https://docs.rs/worker/0.8.5/worker/))

### Data & Databases

- [Distributed Key-Value Stores](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/specialized-storage-engines/distributed-key-value-stores.md) — Provides access to a distributed key-value store for high-performance, low-latency data retrieval and storage. ([source](https://docs.rs/worker))
- [Binding Management](https://awesome-repositories.com/f/data-databases/key-value-store-clients/cloudflare-workers-kv-stores/binding-management.md) — Offers a unified environment interface to manage key-value namespaces, secrets, and environment variables. ([source](https://cdn.jsdelivr.net/gh/cloudflare/workers-rs@main/README.md))
- [API Response Caching](https://awesome-repositories.com/f/data-databases/api-response-caching.md) — Provides caching mechanisms for storing and retrieving HTTP response objects to reduce network latency. ([source](https://docs.rs/worker/0.8.5/worker/))
- [Cloud Object Storage Clients](https://awesome-repositories.com/f/data-databases/cloud-object-storage-clients.md) — Ships client libraries for uploading, downloading, and listing binary data objects in cloud storage buckets. ([source](https://docs.rs/worker))
- [Stateful Durable Objects](https://awesome-repositories.com/f/data-databases/object-storage/stateful-durable-objects.md) — Provides a mechanism to coordinate stateful worker instances using consistent storage for low-latency access. ([source](https://docs.rs/worker/latest/worker/))
- [Serverless SQLite Managers](https://awesome-repositories.com/f/data-databases/sql-database-management/serverless-sqlite-managers.md) — Manages serverless SQLite databases, including query execution and data management on the edge.
- [SQL Query Execution](https://awesome-repositories.com/f/data-databases/sql-query-execution.md) — Implements the execution of SQL statements and retrieval of structured data using prepared queries. ([source](https://docs.rs/worker))
- [Persistent Relational Storage](https://awesome-repositories.com/f/data-databases/sqlite-storage-adapters/persistent-relational-storage.md) — Provides persistent relational storage and SQL query capabilities through a serverless SQLite interface. ([source](https://cdn.jsdelivr.net/gh/cloudflare/workers-rs@main/README.md))

### Networking & Communication

- [Typed RPC Systems](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/remote-procedure-call-frameworks/json-rpc-interfaces/typed-rpc-systems.md) — Implements a typed remote procedure call system for invoking functions across different serverless worker instances.
- [HTTP Traffic Handling](https://awesome-repositories.com/f/networking-communication/http-traffic-handling.md) — Manages and modifies incoming and outgoing HTTP requests, including URI and status code manipulation. ([source](https://docs.rs/http/latest/http/))
- [Request Routing](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-routing-traffic-management/request-routing.md) — Maps URL patterns to specific handler functions using path parameters and wildcards for edge request routing. ([source](https://cdn.jsdelivr.net/gh/cloudflare/workers-rs@main/README.md))
- [Remote Procedure Calls](https://awesome-repositories.com/f/networking-communication/remote-procedure-calls.md) — Allows invoking functions on remote worker instances as if they were local via client-side bindings. ([source](https://docs.rs/worker/0.8.5/worker/))
- [WebSocket Managers](https://awesome-repositories.com/f/networking-communication/websocket-managers.md) — Manages bidirectional WebSocket connections to enable real-time data streaming for live communication events. ([source](https://docs.rs/worker/0.8.5/worker/))

### Programming Languages & Runtimes

- [Edge Runtime Bindings](https://awesome-repositories.com/f/programming-languages-runtimes/edge-runtime-bindings.md) — Provides a complete set of Rust bindings and types for building functions on the Cloudflare Workers platform.
- [RPC Interface Macros](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/language-features/metaprogramming/procedural-macros/rpc-interface-macros.md) — Uses procedural macros to define and export type-safe function signatures for distributed remote procedure calls.

### Software Engineering & Architecture

- [Async Event Loop Runtimes](https://awesome-repositories.com/f/software-engineering-architecture/async-event-loop-runtimes.md) — Utilizes an async runtime to process HTTP requests and queue messages without blocking execution.
- [Remote Procedure Calls](https://awesome-repositories.com/f/software-engineering-architecture/remote-procedure-calls.md) — Exports internal functions via bindings so they can be invoked by other remote workers in the network. ([source](https://cdn.jsdelivr.net/gh/cloudflare/workers-rs@main/README.md))
- [Host Service Bindings](https://awesome-repositories.com/f/software-engineering-architecture/runtime-configuration-apis/host-service-bindings.md) — Provides ergonomic bindings to access environment variables and platform services from the host runtime. ([source](https://docs.rs/worker/index.html))
- [Distributed State Managers](https://awesome-repositories.com/f/software-engineering-architecture/state-management/object-state-trackers/distributed-state-managers.md) — Coordinates transactional storage and low-latency state across distributed edge locations using Durable Objects.
- [Trait-Based Service Abstractions](https://awesome-repositories.com/f/software-engineering-architecture/trait-based-service-abstractions.md) — Maps host environment services and platform APIs to Rust traits for type-safe access.

### Web Development

- [HTTP Request Handling](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-request-handling.md) — Processes incoming web traffic and generates responses using standardized web request and response types. ([source](https://docs.rs/worker))
- [Request Middleware](https://awesome-repositories.com/f/web-development/request-middleware.md) — Ships a framework for intercepting and processing HTTP requests, managing WebSockets, and caching content.
- [Wasm Execution Frameworks](https://awesome-repositories.com/f/web-development/serverless-frameworks/wasm-execution-frameworks.md) — Provides a high-performance environment for executing logic at the edge via WebAssembly modules.
- [Web Caching](https://awesome-repositories.com/f/web-development/data-fetching-caching/web-caching.md) — Implements systems for storing and serving web assets locally to improve load times and availability. ([source](https://docs.rs/worker))

### Artificial Intelligence & ML

- [Edge AI Inference](https://awesome-repositories.com/f/artificial-intelligence-ml/edge-ai-inference.md) — Provides primitives to invoke artificial intelligence models at the edge for text generation and data analysis.
- [AI Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/model-integration-pipelines/ai-model-integrations.md) — Provides interfaces for connecting artificial intelligence models to edge functions for text generation and data analysis. ([source](https://docs.rs/worker))
