This commit is contained in:
nora 2023-03-07 17:06:33 +01:00
parent 20031c3035
commit 8b35cfc701
4 changed files with 7 additions and 23 deletions

View file

@ -18,11 +18,6 @@ pub trait Accept {
type Conn;
type Error;
fn poll_accept(
self: Pin<&mut Self>,
cx: &mut task::Context<'_>,
) -> Poll<Option<Result<Self::Conn, Self::Error>>>;
}
#[cfg(feature = "stream")]
@ -39,12 +34,6 @@ where
{
type Conn = IO;
type Error = E;
fn poll_accept(
self: Pin<&mut Self>,
cx: &mut task::Context<'_>,
) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
loop {}
}
}
FromStream { stream }
}

View file

@ -3,14 +3,15 @@ use super::accept::Accept;
use super::conn::Http as Http_;
#[cfg(all(feature = "tcp"))]
use super::tcp::AddrIncoming;
use crate::body::{Body};
use crate::body::{Body, HttpBody};
use crate::common::exec::Exec;
use crate::common::exec::{NewSvcExec};
use crate::common::{task, Future, Pin, Poll};
use crate::common::exec::{ConnStreamExec, NewSvcExec};
use crate::common::{task, Future, Pin, Poll, Unpin};
use crate::service::{HttpService, MakeServiceRef};
use pin_project_lite::pin_project;
use std::error::Error as StdError;
#[cfg(feature = "tcp")]
use tokio::io::{AsyncRead, AsyncWrite};
pub struct Server<I, S, E = Exec> {
incoming: I,
make_service: S,
@ -90,7 +91,7 @@ where
}
pub(crate) mod new_svc {
use super::Watcher;
use crate::body::{Body};
use crate::body::{Body, HttpBody};
use crate::common::exec::ConnStreamExec;
use crate::common::{task, Future, Pin, Poll};
use crate::service::HttpService;

View file

@ -63,12 +63,6 @@ impl AddrIncoming {
impl Accept for AddrIncoming {
type Conn = AddrStream;
type Error = io::Error;
fn poll_accept(
mut self: Pin<&mut Self>,
cx: &mut task::Context<'_>,
) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
loop {}
}
}
impl fmt::Debug for AddrIncoming {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

View file

@ -30,7 +30,7 @@ where
pub trait MakeServiceRef<Target, ReqBody> {
type ResBody;
type Error;
type Service: HttpService<ReqBody, ResBody = Self::ResBody, Error = Self::Error>;
type Service: HttpService<ReqBody>;
}
impl<T, Target, E, ME, S, F, IB, OB> MakeServiceRef<Target, IB> for T