fn run_request<F>(&self, f: F) -> Result<F::Item, TestRequestError>
    where
        F: Future<Error = hyper::Error>,
    {
        let timeout_duration = Duration::from_secs(self.data.timeout);
        let timeout = Timeout::new(timeout_duration, &self.data.core.borrow().handle())
            .map_err(|e| TestRequestError::IoError(e))?;

        let run_result = {
            let mut core = self.data.core.borrow_mut();
            core.run(f.select2(timeout))
        };

        match run_result {
            Ok(future::Either::A((item, _))) => Ok(item),
            Ok(future::Either::B(_)) => Err(TestRequestError::TimedOut),
            Err(future::Either::A((e, _))) => Err(TestRequestError::HyperError(e)),
            Err(future::Either::B((e, _))) => Err(TestRequestError::IoError(e)),
        }
    }
/// Runs the event loop until the response future is completed.
///
/// If the future came from a different instance of `TestServer`, the event loop will run until
/// the timeout is triggered.
Runs the event loop until the response future is completed.
If the future came from a different instance of `TestServer`, the event loop will run until
the timeout is triggered.
Runs the event loop until the response future is completed . If the future came from a different instance of ` TestServer ` the event loop will run until the timeout is triggered .
fn run_request<F>(&self, f: F) -> Result<F::Item, TestRequestError>
    where
        F: Future<Error = hyper::Error>,
    {
        let timeout_duration = Duration::from_secs(self.data.timeout);
        let timeout = Timeout::new(timeout_duration, &self.data.core.borrow().handle())
            .map_err(|e| TestRequestError::IoError(e))?;
        let run_result = {
            let mut core = self.data.core.borrow_mut();
            core.run(f.select2(timeout))
        };
        match run_result {
            Ok(future::Either::A((item, _))) => Ok(item),
            Ok(future::Either::B(_)) => Err(TestRequestError::TimedOut),
            Err(future::Either::A((e, _))) => Err(TestRequestError::HyperError(e)),
            Err(future::Either::B((e, _))) => Err(TestRequestError::IoError(e)),
        }
    }
fn run_request < F > ( & self , f : F ) -> Result < F :: Item , TestRequestError > where F : Future < Error = hyper :: Error > , { let timeout_duration = Duration :: from_secs ( self . data . timeout ) ; let timeout = Timeout :: new ( timeout_duration , & self . data . core . borrow ( ) . handle ( ) ) . map_err ( | e | TestRequestError :: IoError ( e ) ) ? ; let run_result = { let mut core = self . data . core . borrow_mut ( ) ; core . run ( f . select2 ( timeout ) ) } ; match run_result { Ok ( future :: Either :: A ( ( item , _ ) ) ) => Ok ( item ) , Ok ( future :: Either :: B ( _ ) ) => Err ( TestRequestError :: TimedOut ) , Err ( future :: Either :: A ( ( e , _ ) ) ) => Err ( TestRequestError :: HyperError ( e ) ) , Err ( future :: Either :: B ( ( e , _ ) ) ) => Err ( TestRequestError :: IoError ( e ) ) , } }
Runs the event loop until the response future is completed.
Runs the event loop until the response future is completed .
&self
f
F
&self
f
F