pub struct Shared<T>(/* private fields */);Expand description
An error that is not Clone, shared behind an Arc so [Error] can be.
It derefs to the error it holds, and that error, not the Shared, is what
[Error]’s source returns, so a caller can
downcast it:
use std::error::Error as _;
use thunderstore_engine::Error;
let err = Error::from(std::io::Error::other("gone"));
assert!(err.source().unwrap().downcast_ref::<std::io::Error>().is_some());Trait Implementations§
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more