Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow AggregatedBytes to be constructed directly from segmented bytes #3635

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thedodd
Copy link

@thedodd thedodd commented May 9, 2024

Motivation and Context

This is useful for cases where I already have a segmented buffer of bytes, and I need to stream them to S3 as a single object.

Description

Internal to this crate, the AggregatedBytes struct can be constructed directly from a SegmentedBytes buffer.

There are cases where folks would like to perform this same thing.

Testing

I am currently using this for a project where a segmented buffer of bytes is streamed to S3 as a single object.

Checklist


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@thedodd thedodd requested review from a team as code owners May 9, 2024 01:19
This is useful for cases where a segmented buffer of bytes is already
present. A good used case is for streaming the segmented bytes
to S3 as a single object.
@ysaito1001
Copy link
Contributor

Thank you for contributing! I suspect our CI may not be happy with the change because it now exposes in a stable crate (aws-smithy-types) a type SegmentedBuf from an unstable crate (bytes-utils which is pre 1.0). The CI only allows for items from a stable crate to be exposed in a stable crate.

Internal to this crate, the AggregatedBytes struct can be constructed directly from a SegmentedBytes buffer.

Since you mentioned "Internal to this crate", maybe you mean pub(crate) fn from_segmented ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants