Skip to content

[ENHANCEMENT] Support clone for BulkOperation and similar structs #195

@oeed

Description

@oeed

Is your feature request related to a problem? Please describe.
I am needing to implement retry logic for my requests as we're very occasionally encountering 502s on AWS. For most requests this can be done fairly easily, as .body() can take a borrowed value.

However, Bulk requests require taking ownership of the Vec<BulkOperation<..>>, and additionally BulkOperation doesn't implement clone – so the only way around this is to make your own bulk operation struct that can be cloned then converted.

Describe the solution you'd like
There are a few possible solutions of varying complexity and effort required:

  • implementing exponential back off within the crate itself
  • make NdBody take a reference to the body vec, rather than ownership
  • simply derive Clone on BulkOperation (and maybe other structs of similar usage)

I'd happily provide a PR for the last two, although the first is certainly a far more complex solution that mightn't be desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions