pub struct IntoStringIter<Ctx, Seq, Err = Infallible> { /* private fields */ }Expand description
Turns a WritableSeq into an iterator over owned strings.
The iterator implementation calls InMemoryOutput::try_print_output for each writable produced by the sequence. It uses Rust’s async mechanics in order to invert control flow and produce lazy iteration, making sure to return complete futures from the crate::SequenceAccept when the iterator is ready to advance. However, this type expects a monopoly on such async control flow and may panic if extraneous async waiting is introduced.
Accordingly, this type is intended mainly for testing purposes, allowing the caller to check the output of their WritableSeq implementations.
§Iteration and Errors
The default error type is no error (infallible). However, the caller can specify a different error type in accordance with InMemoryOutput.
If any of the writable values produces an error, it is returned instead of the string for that item in the iterator. However, if the sequence itself produces an error, then the iterator will produce an error as its final item and stop.
§Panics
Iteration may panic if the sequence or any of its writable outputs returns a future that yields a pending poll based on external async computations (in particular, only pending polls caused by the iterative backpressure emitted from the crate::SequenceAccept implementation are allowed)