I have a function that returns an iterator trait object, i.e. something like
fn foo<'a>(...) -> Result<Box<Iterator<Item = SomeType> + 'a + Send>>
However, the struct and methods are written using
'static lifetimes for the iterator. For example, the iter method has the following signature:
pub fn iter<I>(iter: I) -> StreamingResponse<T> where I : Iterator<Item=T> + Send + 'static
Is there a way to reconcile the lifetimes so that I can can pass the result of
StreamingResponse::iter? Do I have to change
foo to return a concrete iterator, instead of a trait object?