-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tutorial on how to use Workers KV directly from Rust #1902
Add tutorial on how to use Workers KV directly from Rust #1902
Conversation
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
this is awesome!! do you mind doing a soft wrap instead of hard wrap throughout this file? will make it easier to review. we'll rope in some members of the team to check this out once i can take an initial look |
@signalnerve sure, done! |
By the way, the following PR might also be relevant in the context of Rust workers: cloudflare/wrangler-action#61 (I'm mentioning it here since I wasn't sure how actively the wrangler-action repo is being maintained.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding in my notes for style guide revision.
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com>
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
} | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an example repo that can be linked down here in a conclusion paragraph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now pushed the full example to https://github.com/fkettelhoit/workers-kv-from-rust and added a short note in the last paragraph. Feel free to move the code over to some Cloudflare repository, if you would prefer not to link to external repositories.
Co-authored-by: Kristian Freeman <kristian@kristianfreeman.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final review comments
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/workers-kv-from-rust/index.md
Outdated
Show resolved
Hide resolved
Final review comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved from style guide review but need @signalnerve to give final okay.
During a call with @Albertozhao today he mentioned that a code sample showing how to use Workers KV directly from a Rust worker could be a suitable addition to the existing docs. This PR is a tutorial that shows how to wrap a subset of the Workers KV API in rust and use it to create a worker that exposes simple get and put operations, with the following end result: