-
Notifications
You must be signed in to change notification settings - Fork 192
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
Update: swap pin-project for pin-project-lite #1503
Conversation
/// | ||
/// This will yield an `Err(SdkError::ConstructionFailure)` if a message can't be | ||
/// marshalled into an Event Stream frame, (e.g., if the message payload was too large). | ||
pub struct MessageStreamAdapter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <T, E>
generic args disappeared? Make sure to test this crate with --all-features
since the event stream parts aren't on by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, good catch!
#[pin] | ||
stream: Pin<Box<dyn Stream<Item = Result<T, BoxError>> + Send>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is pin projection actually needed here if the member is Pin
? It seems like it shouldn't be, but I'm not 100% sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why it needs to be Pin
but if I remove it then the compiler starts complaining about it not implementing some obtuse generic traits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once { | ||
#[pin] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do Once
and Dyn
actually need #[pin]
? I understand why Streaming
needs it, but I'm fuzzy on why these would need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dyn
complains without it but Once
seems to be ok when I remove it
pin_project! { | ||
#[project = EnumProj] | ||
pub enum MapRequestFuture<F, E> { | ||
Inner { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really related to your changes, but the name Inner
is kind of confusing to me here. Maybe we should have called it Pending
or something? Is there a broader idiomatic pattern for this with futures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at it, I would name the variants Pending
and Complete
. @rcoh what do you think?
A new generated diff is ready to view.
A new doc preview is ready to view. |
#[pin] | ||
stream: Pin<Box<dyn Stream<Item = Result<T, BoxError>> + Send>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
#932
Description
swap pin-project for pin-project-lite
Testing
ran existing tests
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.