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
sourceimpl<T: Into<PersyError>> PE<T>
impl<T: Into<PersyError>> PE<T>
pub fn error(self) -> T
pub fn persy_error(self) -> PersyError
Trait Implementations
sourceimpl<T: Into<PersyError>> Deref for PE<T>
impl<T: Into<PersyError>> Deref for PE<T>
sourceimpl<T: Error + Display + Into<PersyError>> Error for PE<T>
impl<T: Error + Display + Into<PersyError>> Error for PE<T>
sourcefn 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 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl<S, D> From<S> for PE<D>where
S: Into<D>,
D: Into<PersyError>,
S: Into<PersyError>,
impl<S, D> From<S> for PE<D>where
S: Into<D>,
D: Into<PersyError>,
S: Into<PersyError>,
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more