Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is
#[non_exhaustive]
so that we can add additional fields in the future. AddingCopy
goes against that since it prevents the addition of non-copy fields in the future.The same could apply to the other traits, but in a lesser extent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is only constructed from calling
NamedPipe[Server|Client]::info()
and those are convenience methods to call GetNamedPipeInfo, I wouldn't expect tokio to ever return a different substantially different struct than the one from the win32 api. With that in mind, I don't think#[non_exhaustive]
is super useful here.But if that's a dealbreaker, would this change be acceptable without
Copy
? Or at least with only the addition ofClone
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OS apis such as
GetNamedPipeInfo
are sometimes extended to return additional data in newer versions of the OS.The change is acceptable with just Clone.