ServiceResultExt

Trait ServiceResultExt 

Source
pub trait ServiceResultExt<T, E>: Future<Output = Result<Result<T, E>, ServiceError>> + Sized {
    // Provided method
    fn flatten_into<U>(self) -> impl Future<Output = Result<T, U>> + Send
       where Self: Send,
             U: From<ServiceError> + From<E> { ... }
}
Expand description

Adds .flatten_into::<AppError>() to flatten Result<Result<T,E>, ServiceError> into Result<T, AppError>. Requires AppError: From<ServiceError> + From<E>.

Provided Methods§

Source

fn flatten_into<U>(self) -> impl Future<Output = Result<T, U>> + Send
where Self: Send, U: From<ServiceError> + From<E>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F, T, E> ServiceResultExt<T, E> for F
where F: Future<Output = Result<Result<T, E>, ServiceError>> + Sized,