Comments (3)
Hi @eminence.
Why can't put accept bytes? Stated another way: why is there both a put() and put_bytes() ?
Put is intended for arbitrary data that can be serialized to a string and then put into the KV store. The impl ToRawKvValue for [u8]
is a left over from this pr and is unintentionally included in the library, so it'll be removed before the library is stabilized.
But in this specific case because of the lack of trait specialization what's actually happening is that the impl<T: Serialize> ToRawKvValue for T
impl is being used, creating a number array which isn't allowed by KV. Intended behavior for this is that the value [116, 101, 115, 116]
would be written to the KV as a string, but due to a bug it isn't.
put_bytes
is the intended way for users to write raw bytes to KV stores. In the future there will be put_byte_stream
for streaming bytes and to implement the final type of value for string | ArrayBuffer | ArrayBufferView | ReadableStream
accepted by the put function.
Edit: worker-kv 0.5.1 has been released fixing this
from workers-rs.
Just a follow-up & to close this out:
Edit: worker-kv 0.5.1 has been released fixing this
We plan on cutting a new release including all the latest worker-kv
goodies by end of next week.
from workers-rs.
Sorry for the additional ping @zebp :) If you can shed some light here, it would be much appreciated!
from workers-rs.
Related Issues (20)
- [BUG] http feature is not additive HOT 2
- Make workers-kv a crate in this workspace HOT 1
- Introduce tests for DO transaction API
- Improve Release CI HOT 1
- [BUG] New http return types always use chunked transfer encoding HOT 6
- [Feature] Make `chrono-tz` an optional dependency HOT 8
- Improve top-level error handling HOT 3
- [BUG] `http` feature is not named accurately. HOT 1
- [BUG] `worker-kv` is not released together with other crates HOT 3
- [Feature] Add #[worker::trait_send] for async_trait
- 🤾♀️ [Feature] Most interop methods should be marked with `catch` HOT 4
- worker-kv does not serialize struct metadata HOT 3
- [BUG] CORS Access-Control-Allow-Origin set wrong if using multiple origins
- [BUG] Range requests in R2 are limited to 32 bit offset/length HOT 1
- [Feature] Make ObjectNamespace Send + Sync
- [BUG] No way to return pre-compressed data with Content-Encoding from worker-rs due to missing encodeBody option
- [BUG] templates/axum build error
- [Feature] Some files should be ignored in worker project
- `import shim from ". /shim.mjs"` worked fine on cloudflare pages a couple weeks ago, now I get `TypeError: an.fetch is not a function` HOT 7
- [BUG] `Response.json()` checks Content-Type header
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workers-rs.