workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

BREAKING: Implement more of the R2 API

Open fisherdarling opened this issue 1 year ago • 0 comments

This PR adds two missing parts of the R2 API:

  • An (accidentally) undocmented startAfter option in R2's list objects call
  • R2 PutObject Conditional Support.
    • This is a BREAKING change. When a provided conditional to an R2 PutObject fails, the resultant Object could be null, or None in Rust. The returned object from a PUT is not a Option<Object>.

This API is successfully being used to implement a compare-and-swap (CAS) primitive for an internal project. We ended up not needing the list changes, but I thought it'd be useful nonetheless.

Tasks:

  • [ ] clean up workers-rs tests

fisherdarling avatar Aug 29 '24 09:08 fisherdarling