nagisa / rust_tracy_client

Tracy client libraries for Rust
Apache License 2.0
178 stars 37 forks source link

tracing-tracy: replace baked-in config fields with a `Config` trait #91

Closed nagisa closed 10 months ago

nagisa commented 11 months ago

This allows users to more flexibly adjust the behaviour of the tracing layer. My favourite examples are actually an ability to implement this structure for some other serialization format that holds the application-wide config. That way people do not need to litter their application set up code with accesses to their configuration, conversion and other concerns.

But with this if people want constant evaluation for performance critical applications, now they can do it too.

nagisa commented 11 months ago

In the 2nd commit I went ahead and added an example of how Config trait enables customization beyond what was reasonable with any sort of field-based approach (const or not.)