Retrieving more data can result in three outcomes:
Additional data (a ReadPayload) is available: in this case the future is satisfied with a ReadResponse containing a ReadPayload.
The download is interrupted with an error: in this case the future is satisfied with a ReadResponse containing a Status that describes the error.
The download has completed successfully: in this case the future is satisfied with a ReadResponse containing an OK Status.
A StatusOr<> cannot represent the last bullet point, so we need an absl::variant<> in this case. We could have used StatusOr<absl::optional<ReadPayload>> but that sounds unnecessarily complicated.
Returns
Type
Description
future< ReadResponse >
GetRequestMetadata()
Return the request metadata.
Returns
Type
Description
RpcMetadata
Type Aliases
ReadResponse
Alias Of: absl::variant< ReadPayload, Status >
The value returned by Read(). See the function for more details.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-22 UTC."],[[["This page provides documentation for the `AsyncReaderConnection` class, part of the Google Cloud Storage C++ library, with the latest version being 2.37.0-rc and the current page set to 2.32.0."],["The `AsyncReaderConnection` class is primarily intended for internal use and for testing, and applications should generally use the `AsyncReader` class instead."],["The `AsyncReaderConnection` class includes two primary functions: `Cancel()`, which interrupts the download, and `Read()`, which fetches additional data, and applications should not have more than one `Read()` pending."],["The `Read()` function returns a `ReadResponse` that contains a `ReadPayload` if more data is available, or a `Status` indicating either an error or the successful completion of the download."],["It also supports `GetRequestMetadata()` to return request metadata and has the type alias `ReadResponse` which is an `absl::variant\u003c ReadPayload, Status \u003e`."]]],[]]