Trait pahs_snafu::ProgressSnafuExt [−][src]
Extension trait for pahs’ Progress
type for integration with snafu.
Required methods
fn snafu<C, F, E2>(self, context_fn: F) -> Progress<P, T, E2> where
P: Clone,
C: IntoError<E2, Source = E>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,
[src]
P: Clone,
C: IntoError<E2, Source = E>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,
Maps the error of the progress to a snafu error, with the previous error as the source.
context_fn
has to be a function that returns the context selector of that error.
fn into_snafu_leaf<C, F, E2>(self, context_fn: F) -> Progress<P, T, E2> where
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(E, P) -> C,
E2: Error + ErrorCompat,
[src]
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(E, P) -> C,
E2: Error + ErrorCompat,
Maps the error of the progress to a snafu leaf error.
context_fn
has to be a function that returns the context selector of that leaf error.
fn snafu_leaf<C, F, E2>(self, context_fn: F) -> Progress<P, T, E2> where
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,
[src]
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,
Replaces the error of the progress with a snafu leaf error.
context_fn
has to be a function that returns the context selector of that leaf error.
If you get an error because E
cannot be inferred, try using
into_snafu_leaf
instead to specify the type of the error
(first context_fn
parameter).
Implementations on Foreign Types
impl<P, T, E> ProgressSnafuExt<P, T, E> for Progress<P, T, E>
[src]
fn snafu<C, F, E2>(self, context_fn: F) -> Progress<P, T, E2> where
P: Clone,
C: IntoError<E2, Source = E>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,
[src]
P: Clone,
C: IntoError<E2, Source = E>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,
fn into_snafu_leaf<C, F, E2>(self, context_fn: F) -> Progress<P, T, E2> where
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(E, P) -> C,
E2: Error + ErrorCompat,
[src]
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(E, P) -> C,
E2: Error + ErrorCompat,
fn snafu_leaf<C, F, E2>(self, context_fn: F) -> Progress<P, T, E2> where
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,
[src]
P: Clone,
C: IntoError<E2, Source = NoneError>,
F: FnOnce(P) -> C,
E2: Error + ErrorCompat,