pub struct ArcAnyhowError(/* private fields */);
Expand description
An Arc’ed anyhow error.
It is not intended as a replacement for anyhow’s error, just a way to share it as well as a way to provide an error impl. This means that this error can itself be placed into an anyhow::Error.
§Use Cases
This error is intended to be used where multiple tasks want the result of a singular, shared operation.
Consider a web request to a server to a static resource X.
It is not desired behavior to send multiple parallel requests to resource X at once.
Instead one would send 1 request and have all tasks that need it wait of the result.
However, this means that both X and the error must be clonable.
X can be make Clone with Arc
Implementations§
Source§impl ArcAnyhowError
impl ArcAnyhowError
Sourcepub fn new(error: Error) -> Self
pub fn new(error: Error) -> Self
Make a new ArcAnyhowError
.
Trait Implementations§
Source§impl Clone for ArcAnyhowError
impl Clone for ArcAnyhowError
Source§fn clone(&self) -> ArcAnyhowError
fn clone(&self) -> ArcAnyhowError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ArcAnyhowError
impl Debug for ArcAnyhowError
Source§impl Display for ArcAnyhowError
impl Display for ArcAnyhowError
Source§impl Error for ArcAnyhowError
impl Error for ArcAnyhowError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for ArcAnyhowError
impl RefUnwindSafe for ArcAnyhowError
impl Send for ArcAnyhowError
impl Sync for ArcAnyhowError
impl Unpin for ArcAnyhowError
impl UnwindSafe for ArcAnyhowError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.