error-stack: Is there any way to clone error_stack::Result
?
#2764
Answered
by
TimDiekmann
jrmoulton
asked this question in
Help (Libraries)
-
Both T and E implement Clone but I can't clone a Report. Is there any way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
TimDiekmann
Jul 19, 2023
Replies: 1 comment 1 reply
-
No, a |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jrmoulton
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, a
Report
cannot be cloned as the errors inside ofReport
don't necessarily implementClone
. This would require a boundT: Clone
on any operation on Report (i.e. all contexts and attachments would need to beClone
able) but it's very common that errors don't implementClone
. As a very prominent example,std::io::Error
does not implementClone
. Adding aClone
bound would imply that many errors would not work witherror-stack
anymore.