-
Notifications
You must be signed in to change notification settings - Fork 188
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
Why reimplementing a stream? #3361
Comments
It seems I can use something like this which is not too bad, but just weird: pub struct SmithyStreamAdapt<I>(PaginationStream<I>);
impl <I> Stream for SmithyStreamAdapt<I> {
type Item = I;
fn poll_next(mut self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<Option<Self::Item>> {
self.0.poll_next(cx)
}
} |
It's a consequence of not being able to make breaking changes to the SDK after the GA launch. Since the Rust Async Working Group is actively working on a stable replacement for the Stream trait, we consider it to be unstable and a risk for future breaking changes. I agree that it's not ideal though. Hopefully we get something in the standard library sooner than later. In the meantime, we just released a convenience in the aws-smithy-types-convert crate behind the use aws_smithy_types_convert::stream::PaginationStreamExt;
let stream = s3_client.list_objects_v2().bucket("...").into_paginator().send().into_stream_03x(); Thank you, @Ploppz, for the contribution. |
Ok thanks for the reply. |
For the PaginationStream.
A Stream is a basic thing in Rust, everyone uses it, theres tons of utilities and code around. It seems you have replaced it with a custom type that resembles a stream but is not actually a Stream. I see #2413 but can we at least provide an opt in compat or something, it makes it very difficult and weird to work with.
The text was updated successfully, but these errors were encountered: