Skip to content

Implement method to find reports by type #159

@mkatychev

Description

@mkatychev

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions