llogiq / flame

An intrusive flamegraph profiling tool for rust.
Apache License 2.0
694 stars 30 forks source link

feature request: end_with API #8

Closed llogiq closed 8 years ago

llogiq commented 8 years ago

To allow easy insertion of frames without having to rely on the guard interface, having a method like flame::end_with<T>(frame: &str, result: T) -> T could make insertion on exit easier. Otherwise we'd have to create a temporary to store a return value.

TyOverby commented 8 years ago

This could be useful, especially for code-generation like flamer.

I can add this at the end of the day today, but if you'd like it sooner, feel free to open up a PR. I've also sent you an invitation to be a maintainer to FLAME, so if you're interested, you could merge your PR yourself!