Thank you for this Rust library. It works marvels.
I see that you guard your API, to make it future proof/implementation-independent. Like KeyValueMap is a value type around HashMap, rather than HashMap itself.
If you didn't intend KeyValueMap to be Clone, you may want to make it a one-field struct {} rather than a one-field tuple, because a tuple automatically is Clone or even Copy (and I believe it's automatically Debug, too) if all its fields are Clone or Copy (or Debug). Of course, you may have intended KeyValueMap to be Clone, which I'd be thankful for.
(I've checked and there are no other named tuples around: egrep -r "struct +[a-zA-Z_]+ *\(" src.)
On the other hand, Clone is very handy. For example, Axum requires the (HTTP GET/POST...) service handler function/closure to be Clone (https://docs.rs/axum/latest/axum/handler/trait.Handler.html). Currently there's no way to instantiate one Client, use it before spinning up Axum and pass it to the handler(s), too.
So it would help if KeyValueMap, Params, RequestTemplate and Client (or at least Client and/or RequestTemplate) were Clone, please.
Hi at LogDNA/Mezmo crate maintainer/creator,
Thank you for this Rust library. It works marvels.
I see that you guard your API, to make it future proof/implementation-independent. Like
KeyValueMap
is a value type aroundHashMap
, rather thanHashMap
itself.If you didn't intend
KeyValueMap
to beClone
, you may want to make it a one-field struct {} rather than a one-field tuple, because a tuple automatically isClone
or evenCopy
(and I believe it's automaticallyDebug
, too) if all its fields areClone
orCopy
(orDebug
). Of course, you may have intendedKeyValueMap
to beClone
, which I'd be thankful for. (I've checked and there are no other named tuples around:egrep -r "struct +[a-zA-Z_]+ *\(" src
.)On the other hand,
Clone
is very handy. For example, Axum requires the (HTTP GET/POST...) service handler function/closure to beClone
(https://docs.rs/axum/latest/axum/handler/trait.Handler.html). Currently there's no way to instantiate oneClient
, use it before spinning upAxum
and pass it to the handler(s), too.So it would help if
KeyValueMap, Params, RequestTemplate
andClient
(or at leastClient
and/orRequestTemplate
) wereClone
, please.