cloudflare · Cloudflare Workers Docs
Workers Kv From Rust Use Workers KV directly from Rust
A step-by-step tutorial for setting up a Cloudflare Worker using the Rust toolchain to perform CRUD operations on a Workers KV namespace.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Kv From Rust Use Workers KV directly from Rust
A step-by-step tutorial for setting up a Cloudflare Worker using the Rust toolchain to perform CRUD operations on a Workers KV namespace.
When To Use
Use when you need to implement a Rust-based Cloudflare Worker that interacts with a KV namespace to store and retrieve key-value pairs via HTTP routes.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-kv-from-rust-index-use-directly-workflow-guide.md | A tutorial guide on how to read and write to Cloudflare Workers KV namespaces directly from a Rust worker using the workers-rs crate. | Questions about a tutorial guide on how to read and write to Cloudflare Workers KV namespaces directly from a Rust worker using the w... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-kv-rust-tutor.text | A text file containing the initial setup steps and cargo-generate installation command for the Cloudflare Workers KV Rust tutorial. | Exact payloads, commands, or snippets shown in A text file containing the initial setup steps and cargo-generate installation command for the Cloudflare Workers KV... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-rust-kv-usage.text | A cargo generate template command and configuration for initializing a Cloudflare Workers project using Rust to interact with Workers KV. | Exact payloads, commands, or snippets shown in A cargo generate template command and configuration for initializing a Cloudflare Workers project using Rust to inter... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-kv-rust-names.text | The wrangler command used to create a new Cloudflare Workers KV namespace named cities. | Exact payloads, commands, or snippets shown in The wrangler command used to create a new Cloudflare Workers KV namespace named cities. |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-kv-rust-wrang.text | A wrangler.toml configuration file defining a KV namespace binding for a Cloudflare Workers Rust project. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file defining a KV namespace binding for a Cloudflare Workers Rust project. |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-kv-rust-wrang-2.text | A wrangler.toml configuration snippet defining a KV namespace binding named cities for a Rust-based Cloudflare Worker. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration snippet defining a KV namespace binding named cities for a Rust-based Cloudflare Worker. |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-rust-kv-usage-2.text | A Rust code example demonstrating how to interact with Cloudflare Workers KV using the worker crate and serde for serialization. | Exact payloads, commands, or snippets shown in A Rust code example demonstrating how to interact with Cloudflare Workers KV using the worker crate and serde for ser... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-rust-kv-put.text | A Rust code snippet demonstrating how to use the Workers KV binding to store a city value associated with a country key within a Worker. | Exact payloads, commands, or snippets shown in A Rust code snippet demonstrating how to use the Workers KV binding to store a city value associated with a country k... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-kv-rust-curl-.text | A curl command demonstrating how to send a JSON request to a Cloudflare Worker to interact with KV storage using Rust. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a JSON request to a Cloudflare Worker to interact with KV storage using Rust. |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-rust-kv-get-a.text | A Rust code snippet demonstrating how to asynchronously retrieve a value from a Cloudflare Workers KV namespace using the get_async method. | Exact payloads, commands, or snippets shown in A Rust code snippet demonstrating how to asynchronously retrieve a value from a Cloudflare Workers KV namespace using... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-kv-rust-direc.text | A text-based example demonstrating how to perform a curl request to a local worker endpoint to retrieve data from Workers KV using Rust. | Exact payloads, commands, or snippets shown in A text-based example demonstrating how to perform a curl request to a local worker endpoint to retrieve data from Wor... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-rust-kv-usage-3.text | A Rust code example demonstrating how to interact with Cloudflare Workers KV using the worker crate and serde for serialization. | Exact payloads, commands, or snippets shown in A Rust code example demonstrating how to interact with Cloudflare Workers KV using the worker crate and serde for ser... |
examples/workers-kv-from-rust-index-use-directly-cloudflare-workers-kv-rust-deplo.text | The wrangler deploy command used to deploy a Cloudflare Workers project written in Rust. | Exact payloads, commands, or snippets shown in The wrangler deploy command used to deploy a Cloudflare Workers project written in Rust. |
What This Skill Covers
- This tutorial will teach you how to read and write to KV directly from Rust using workers-rs ↗.
- Main sections:
Tags,Before you start,Prerequisites,1\. Create your Worker project in Rust,2\. Create a KV namespace.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/tutorials/workers-kv-from-rust/index.md
