cloudflare-rs
cloudflare-rs copied to clipboard
feat: Derive debug and clone for async client Struct
This pull request enhances the AsyncClient struct by deriving both the Debug and Clone traits. This addresses key usability limitations and improves the client's flexibility within various application architectures.
Motivation:
- Improved Debuggability (
Debug): As previously highlighted in other discussions, the ability to easily inspect the internal state of the AsyncClient during debugging is crucial for diagnosing issues, understanding client configuration, and managing connection pools. Deriving Debug provides a standardized and readily accessible way to achieve this. - Enhanced Flexibility (
Clone): Deriving Clone enables the creation of independent copies of the AsyncClient. This is essential for scenarios such as:- Multi-threaded applications: Passing independent clients to different threads without ownership conflicts. Configuration variations: Creating multiple clients with slightly different configurations (e.g., different timeouts) without modifying the original client.
How did you test this change?
Just like this opened issue #214 , I have the need to derive pDebug and Clone for the async client Struct
Does deriving DebugandClone` not affect anything