aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

Make ec2 `DescribeInstances` builder `Clone`

Open ojacobson opened this issue 3 years ago • 3 comments
trafficstars

Tell us about your request

Many of the request builders in this library implement Clone, but not all of them. The EC2 DescribeInstances request builder appears to only capture Clone values, but is not itself Clone.

Tell us about the problem you're trying to solve.

My underlying goal is to write a generic request paginator trait, so that I can be sure that (up to bugs in request-specific code) pagination is handled consistently and correctly across my codebase. To do so, I use the Clone trait to make copies of the caller's initial request builder, per page, to attach page-specific properties to.

Are you currently working around this issue?

This can somewhat be worked around with a fn that returns a configured builder, rather than cloning an existing builder, but it complicates the definition of my paginator trait to support that.

Additional context

There are probably other builders that should implement Clone but don't. I only know about this one because it affected me.

ojacobson avatar Dec 16 '21 07:12 ojacobson

Think this might be solved by

https://github.com/awslabs/smithy-rs/pull/985

Jacco avatar Dec 16 '21 10:12 Jacco

Think this might be solved by

awslabs/smithy-rs#985

I think that's correct, you could include an integration test in smithy-rs#985 for this specific operation to be sure

rcoh avatar Dec 16 '21 15:12 rcoh

This has been obviated by the built-in paginator (which is great!), so I no longer wish for DescribeInstances to be Clone. I wouldn't object, but I also won't need it.

ojacobson avatar Mar 24 '22 04:03 ojacobson

It looks like DescribeInstances implements Clone now.

jdisanti avatar Sep 30 '22 21:09 jdisanti

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Sep 30 '22 21:09 github-actions[bot]