Skip to content

feat(core)!: extend reader and presign builders and unify blocking presign - #9629

Merged
Xuanwo merged 1 commit into
mainfrom
xuanwo/future-presign-setters
Dec 4, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
xuanwo/future-presign-setters

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Dec 3, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #9544

Rationale for this change

Rust callers configuring reader prefetch or several supported presign options currently have to construct an options struct. The four blocking presign shortcuts also poll the async operation on the caller's thread, while the _options methods dispatch it to the captured runtime.

What changes are included in this PR?

  • Add FutureReader::prefetch, FuturePresignRead::{range, version}, and FuturePresignWrite::{content_language, if_not_exists, if_match, user_metadata, checksum}. The fluent methods use the same option validation and request construction as _options.
  • Delegate the four blocking presign shortcuts to their _options methods with default options.

Are there any user-facing changes?

Rust callers can set read-ahead, presigned byte ranges and versions, and presigned upload metadata and conditions in fluent calls. The presigned write checksum takes a Checksum with the raw bytes of a precomputed full-file digest. OpenDAL passes it as WriteChecksum::Expected, as required by S3 presigning. The available algorithms depend on the service and preset. Send the method and headers from the returned request with the matching upload payload.

Breaking changes

Affected packages: core

Migration:

  • With an idle current-thread Tokio runtime, a blocking presign call can wait indefinitely. Use a multi-thread runtime, or drive the captured current-thread runtime with Runtime::block_on on another thread during the call. In async code, use the async Operator methods.
  • A presign task that panics or is cancelled now returns ErrorKind::Unexpected from the blocking shortcut.

AI Usage Statement

  • Pi through T3 Code ran magpie/codex/gpt-6.2-astra with thinking=high to trace option lowering and service support and identify the blocking runtime migration.
  • Pi through T3 Code ran magpie/codex/gpt-6.2-astra with thinking=xhigh to set the v0.60 implementation scope and coordinate the candidate.
  • Pi through T3 Code ran magpie/codex/gpt-6.2-sol with thinking=max to implement the APIs, write the migration guidance and PR draft, and validate the candidate on NieR. S3 checks exercised local request construction and signing with synthetic credentials. Cloud request execution was outside the verification scope.
  • Pi through T3 Code ran magpie/devin/swe-2-1 with thinking=high to independently review the setters and exercise blocking presign with multi-thread, idle current-thread, and externally driven current-thread runtimes.

…esign

Add fluent options that reuse reader and presign validation. Dispatch the blocking presign defaults through their options methods so they run on the captured Tokio runtime.

The captured runtime must make progress while the caller waits. Document the migration for callers using an idle current-thread runtime.
@Xuanwo
Xuanwo merged commit a07a8a9 into main Dec 4, 2026
144 of 145 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/future-presign-setters branch December 4, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(core): add FutureReader::prefetch, presign fluent setters, and uniform blocking::Operator::presign_* dispatch

2 participants