ServiceFutureExt

Trait ServiceFutureExt 

Source
pub trait ServiceFutureExt<T>: Future<Output = Result<T, ServiceError>> + Sized {
    // Provided method
    fn timeout(
        self,
        duration: Duration,
    ) -> impl Future<Output = Result<T, ServiceError>> + Send
       where Self: Send { ... }
}
Expand description

Adds .timeout(duration) to service calls.

Provided Methods§

Source

fn timeout( self, duration: Duration, ) -> impl Future<Output = Result<T, ServiceError>> + Send
where Self: Send,

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> ServiceFutureExt<T> for F
where F: Future<Output = Result<T, ServiceError>> + Sized,