tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.33k stars 697 forks source link

Please support `Instrument` on types implementing `IntoFuture ` #2859

Open joshtriplett opened 7 months ago

joshtriplett commented 7 months ago

Right now, instrumenting a type that implements IntoFuture requires explicitly calling into_future().instrument(...). I'd love to have an impl of Instrument for any type implementing IntoFuture, to allow writing just .instrument(...).

hawkw commented 7 months ago

Yeah, we should definitely add an implementation for types implementing IntoFuture; the only reason we don't have that already is historical: tracing::Instrument predates IntoFuture being stable in the standard library.