Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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 storage namespace to store and retrieve JSON data.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-kv-from-rust-use-directly-workflow-guide.mdA tutorial guide on reading and writing to Cloudflare Workers KV namespaces directly from Rust using the workers-rs crate.Questions about a tutorial guide on reading and writing to Cloudflare Workers KV namespaces directly from Rust using the workers-rs c...
examples/workers-kv-from-rust-use-directly-cloudflare-workers-kv-rust-cargo-gener.textA text guide outlining the initial steps to set up a Cloudflare Workers KV project using cargo-generate in Rust.Exact payloads, commands, or snippets shown in A text guide outlining the initial steps to set up a Cloudflare Workers KV project using cargo-generate in Rust.
examples/workers-kv-from-rust-use-directly-cloudflare-workers-rust-kv-usage-tutor.textA tutorial guide demonstrating how to interact with Cloudflare Workers KV namespaces directly using the Rust programming language.Exact payloads, commands, or snippets shown in A tutorial guide demonstrating how to interact with Cloudflare Workers KV namespaces directly using the Rust programm...
examples/workers-kv-from-rust-use-directly-cloudflare-workers-kv-rust-namespace-c.textThe 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-use-directly-cloudflare-workers-kv-rust-wrangler-to.textA 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-use-directly-cloudflare-workers-kv-rust-binding-con.textA configuration snippet defining a Workers KV namespace binding for use within a Rust-based Worker.Exact payloads, commands, or snippets shown in A configuration snippet defining a Workers KV namespace binding for use within a Rust-based Worker.
examples/workers-kv-from-rust-use-directly-cloudflare-workers-rust-kv-usage.textA 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-use-directly-cloudflare-workers-kv-rust-put-operati.textA Rust code snippet demonstrating how to use the Workers KV binding to put a key-value pair within a Worker request handler.Exact payloads, commands, or snippets shown in A Rust code snippet demonstrating how to use the Workers KV binding to put a key-value pair within a Worker request h...
examples/workers-kv-from-rust-use-directly-cloudflare-workers-kv-rust-curl-reques.textA curl command demonstrating how to send a JSON request to a local Cloudflare Workers instance 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 local Cloudflare Workers instance to interact with KV st...
examples/workers-kv-from-rust-use-directly-cloudflare-workers-rust-kv-get-async.textA 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-use-directly-cloudflare-workers-kv-rust-curl-reques-2.textA curl command demonstrating how to retrieve a value from a Cloudflare Workers KV namespace using a Rust-based worker.Exact payloads, commands, or snippets shown in A curl command demonstrating how to retrieve a value from a Cloudflare Workers KV namespace using a Rust-based worker.
examples/workers-kv-from-rust-use-directly-cloudflare-workers-rust-kv-get-set.textA Rust implementation using the worker crate to perform GET and POST operations on Cloudflare Workers KV storage.Exact payloads, commands, or snippets shown in A Rust implementation using the worker crate to perform GET and POST operations on Cloudflare Workers KV storage.
examples/workers-kv-from-rust-use-directly-cloudflare-workers-kv-rust-deploy-comm.textThe 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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