googleapis / googleapis/google-cloud-rust

Implement function to return response with metadata

Open
#1,772 0 comments 0 reactions 0 assignees View on GitHub
priority: p3 type: feature request
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

After the work on #1510 we have metadata for each request available in the stubs. Our `.send()` method only returns the body, and we would like to keep it that way because it makes the common case simple.

We would need a new function in each request builder that returns the response with the metadata, something like `send_returning_metadata()` so applications can write:

```rust
let client = Client::builder().build().await?;
let response = client.create_foo("projects/my-project").send().await?; // easy case

// When you must have the data:
let (parts, body) = client.create_foo("projects/my-project").send_returning_metadata().await?.into_parts();
```

I think the only remaining debate is the function name. If only "Boaty McBoatface" was a legal function name all problems would be solved, sigh.

go/cloud-rust:getting-response-metadata

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.