Report should havea a filter/find method to get all reports of a given type.
fn iter_downcast_reports<T: 'static>(
report: &Report<impl ?Sized, Mutable, Local>,
) -> impl Iterator<Item = &T> {
report
.iter_reports()
.filter_map(|r| r.downcast_current_context::<T>())
}
prior art:
Reportshould havea a filter/find method to get all reports of a given type.prior art:
error_stack::Report::downcast_refstd::iter::Iterator::findk