logdna / logdna/logdna-rust

KeyValueMap, Params, RequestTemplate and Client: Clone?

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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 around `HashMap`, rather than `HashMap` itself.

1. 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`.)

3. 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the definitions of KeyValueMap, Params, RequestTemplate, and Client, then inspect their existing derives and ownership of their fields. Determine which types can safely implement Clone and whether the requested API is consistent; done means the selected types support cloning or the issue records a clear maintainer decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.