pub struct CloneableError(pub Error);Expand description
Wrap an error in a new error type that implements Clone
This is useful when two threads/streams share a common fallible source
The variants whose meaning callers read through an accessor rather than
through the message survive the clone: definite not-found errors keep typed
source-chain detection (is_not_found), fenced errors keep their
FenceReason (fence_reason), backpressure stays backpressure
(is_backpressure), and an unknown commit outcome keeps its version
(is_commit_status_unknown) with the typed source degraded to its message.
Timeout and I/O errors preserve their categories. Everything else becomes
Error::Cloned carrying the string representation.
One gap: Error::External is not preserved, because its source is not
cloneable and rebuilding it from a message would leave external_source
returning Some while the downcast the caller wants fails. After a clone,
external_source and into_external no longer recover the original error.
Tuple Fields§
§0: Error