From dd3b3980bf097ec887aa811d59016a107ff692d2 Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 7 Mar 2023 16:49:21 +0100 Subject: [PATCH] loop --- hyper/src/common/exec.rs | 10 ++++------ hyper/src/server/server.rs | 19 +++++-------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/hyper/src/common/exec.rs b/hyper/src/common/exec.rs index ef4b08d..c65734d 100644 --- a/hyper/src/common/exec.rs +++ b/hyper/src/common/exec.rs @@ -8,14 +8,13 @@ use crate::rt::Executor; #[cfg(all(feature = "server", any(feature = "http1", feature = "http2")))] use crate::server::server::{new_svc::NewSvcTask, Watcher}; #[cfg(all(feature = "server", any(feature = "http1", feature = "http2")))] -use crate::service::HttpService; use std::fmt; use std::future::Future; use std::pin::Pin; use std::sync::Arc; #[cfg(feature = "server")] -pub trait ConnStreamExec: Clone { - fn execute_h2stream(&mut self, fut: H2Stream); +pub trait ConnStreamExec: Clone { + fn execute_h2stream(&mut self); } #[cfg(all(feature = "server", any(feature = "http1", feature = "http2")))] pub trait NewSvcExec>: Clone { @@ -39,7 +38,7 @@ where H2Stream: Future + Send + 'static, B: HttpBody, { - fn execute_h2stream(&mut self, fut: H2Stream) { + fn execute_h2stream(&mut self) { loop {} } } @@ -48,7 +47,6 @@ where impl NewSvcExec for Exec where NewSvcTask: Future + Send + 'static, - S: HttpService, W: Watcher, { fn execute_new_svc(&mut self, fut: NewSvcTask) { @@ -62,7 +60,7 @@ where H2Stream: Future, B: HttpBody, { - fn execute_h2stream(&mut self, fut: H2Stream) { + fn execute_h2stream(&mut self) { loop {} } } diff --git a/hyper/src/server/server.rs b/hyper/src/server/server.rs index 4739f33..9eb7119 100644 --- a/hyper/src/server/server.rs +++ b/hyper/src/server/server.rs @@ -79,7 +79,6 @@ impl Builder { } pub trait Watcher: Clone { type Future; - fn watch(&self) -> Self::Future; } #[allow(missing_debug_implementations)] #[derive(Copy, Clone)] @@ -89,39 +88,31 @@ where S: HttpService, { type Future = (); - fn watch(&self) -> Self::Future { - loop {} - } } pub(crate) mod new_svc { use super::Watcher; use crate::body::{Body, HttpBody}; use crate::common::exec::ConnStreamExec; - use crate::common::{task, Future, Pin, Poll, Unpin}; + use crate::common::{task, Future, Pin, Poll}; use crate::service::HttpService; - use std::error::Error as StdError; - use tokio::io::{AsyncRead, AsyncWrite}; pub struct NewSvcTask> { state: State, } - pub(super) enum State> { - Connecting { a: (I, S, W, E) }, - - Connected { future: W::Future }, + pub(super) struct State> { + a: (I, S, E), + future: W::Future, } impl, E, W: Watcher> NewSvcTask { - pub(super) fn new(watcher: W) -> Self { + pub(super) fn new(_: W) -> Self { loop {} } } impl Future for NewSvcTask where S: HttpService, - B: HttpBody + 'static, - B::Error: Into>, E: ConnStreamExec, W: Watcher, {