-
Notifications
You must be signed in to change notification settings - Fork 18
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
Multipart Forms #21
Comments
Sorry for the late reply! I personally don't have spare cycles for this, and I also don't need it right now, as most HTTP-related code on Embedded seems to get away with other POST payloads (most often than not
I think it would rather require Saying that ^^^ because your task is then to map
Couldn't find much info about "sans-io" by a quick googling, but regardless, mapping an fn as_stream<R: embedded_io_async::Read>(read: R) -> impl futures::Stream<Output = std::io::Result<Bytes>> {
futures::stream::poll_fn(move |ctx| {
let mut buf = [0; 64];
let read = core::pin::pin!(read.read(&mut buf));
match read.poll(ctx) {
Ok(0) => Poll::Ready(None), // Reading 0 bytes from the input stream <=> eof
Ok(n) => Poll::Ready(Some(alloc::boxed::Box::new(&buf[..n]),
Err(e) => Poll::Ready(Some(convert_to_io_err(e)),
}
})
} With that said, using
Yes, if it only wants blocking reads, this is a no-go. If it also supports
If you have something which implements
Basically, the
As per above, somebody needs to drive this. :) |
UPDATE: Unfortunately the above code might not work as Also see this. |
Feature request for multi part forms support. This crate comes the closest out of the many that I have tried, but requires stream support to be implemented for a connection/request. I hacked it together with
sans_io
, but I cannot get thebytes::Bytes
to be cast from the buffer type&[u8]
I have also tried:
std::io::Read
and is no longer in development.futures_util::stream::StreamExt
.Are there any plans for an embedded-io-async approach for this?
The text was updated successfully, but these errors were encountered: