Skip to content

Conversation

@aatifsyed
Copy link
Contributor

Motivation

I want to downcast a hyper::upgrade::Upgraded.
This also makes the code consistent with Take, and other combinators like those found in std::iter

Solution

@ADD-SP
Copy link
Member

ADD-SP commented Sep 10, 2025

I want to downcast a hyper::upgrade::Upgraded.

Sorry, I don't understand your usecase, could you please elaborate your usecase?

@ADD-SP ADD-SP added C-enhancement Category: A PR with an enhancement or bugfix. A-tokio Area: The main tokio crate M-io Module: tokio/io S-waiting-on-author Status: awaiting some action (such as code changes) from the PR or issue author. labels Sep 10, 2025
@aatifsyed
Copy link
Contributor Author

Sorry, I don't understand your usecase, could you please elaborate your usecase?

I'll rephrase :)

I want to downcast a trait object.
To downcast, I'd like to name the trait object.
I can't name a Chain. This PR makes that possible.

Also makes Chain more consistent with Take, which is already nameable.

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to expose the future types, but Chain is like Take that is already exposed so I'm okay with this.

@Darksonn Darksonn merged commit 7127e25 into tokio-rs:master Sep 10, 2025
103 checks passed
@Darksonn Darksonn mentioned this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-io Module: tokio/io S-waiting-on-author Status: awaiting some action (such as code changes) from the PR or issue author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants