You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
In the documentation for server::Multipart::foreach_iterator, you use an internal iterator due to Rust's iterators not supporting elements that borrow from the iterator. There is a streaming-iterator crate with a StreamingIterator type that properly allows for elements borrowing from the iterator. Would it be possible for you to also support/switch over to using this?
The text was updated successfully, but these errors were encountered:
I've been aware of the streaming-iterator crate for a while, but it currently does not support this use-case very well. The problem with the StreamingIterator trait is that it only supports yielding immutable references to items whereas the API I want actually needs a higher-kinded lifetime bound on Self::Item and then binds that lifetime to self on fn next(&mut self); for example, with some hypothetical syntax:
However, this is currently not supported in the language. The Associated Type Constructors RFC would enable this, but it's still a few steps away from a concrete implementation. I'm sure there's some type system hacks to make this work in current Rust, but I'd rather not overcomplicate the API when it already works as-is (using while let Some(entry) = multipart.next_entry()? {}).
In the documentation for
server::Multipart::foreach_iterator
, you use an internal iterator due to Rust's iterators not supporting elements that borrow from the iterator. There is a streaming-iterator crate with aStreamingIterator
type that properly allows for elements borrowing from the iterator. Would it be possible for you to also support/switch over to using this?The text was updated successfully, but these errors were encountered: