pub enum PE<T: Into<PersyError>> {
PE(T),
}
Expand description
Wrapper enum for all the possible Persy errors,
All the public functions use this enum as error return type specialized with the specific error for the function.
to implement a catch all error for forward just implement a from as follow
enum YourError {
Persy(persy::PersyError),
}
impl<T: Into<persy::PersyError>> From<persy::PE<T>> for YourError {
fn from(err: persy::PE<T>) -> YourError {
YourError::Persy(err.error().into())
}
}
Variants§
PE(T)
Implementations§
source§impl<T: Into<PersyError>> PE<T>
impl<T: Into<PersyError>> PE<T>
pub fn error(self) -> T
pub fn persy_error(self) -> PersyError
Trait Implementations§
source§impl<T: Error + Display + Into<PersyError>> Error for PE<T>
impl<T: Error + Display + Into<PersyError>> Error for PE<T>
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl<T> RefUnwindSafe for PE<T>where
T: RefUnwindSafe,
impl<T> Send for PE<T>where
T: Send,
impl<T> Sync for PE<T>where
T: Sync,
impl<T> Unpin for PE<T>where
T: Unpin,
impl<T> UnwindSafe for PE<T>where
T: UnwindSafe,
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