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

Add AsyncReadBody #1072

Merged
merged 3 commits into from
Jun 8, 2022
Merged

Add AsyncReadBody #1072

merged 3 commits into from
Jun 8, 2022

Conversation

davidpdrsn
Copy link
Member

Motivation

I think having an easy way to respond with an AsyncRead is useful. Its currently possible by combining things from the ecosystem but that requires you know about tokio-util.

I'm also thinking about adding a FileResponse that'll automatically set content-type and related headers. That'll require an AsyncReadBody which also makes sense on its own.

Solution

Add AsyncReadBody which is a body created from a tokio::io::AsyncRead.

axum-extra/Cargo.toml Outdated Show resolved Hide resolved
axum-extra/src/body/async_read_body.rs Show resolved Hide resolved
@davidpdrsn davidpdrsn merged commit 73b1baf into main Jun 8, 2022
@davidpdrsn davidpdrsn deleted the async-read-body branch June 8, 2022 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants