mirror of
https://github.com/Noratrieb/icefun.git
synced 2026-01-14 12:55:02 +01:00
loop
This commit is contained in:
parent
20031c3035
commit
8b35cfc701
4 changed files with 7 additions and 23 deletions
|
|
@ -18,11 +18,6 @@ pub trait Accept {
|
||||||
type Conn;
|
type Conn;
|
||||||
|
|
||||||
type Error;
|
type Error;
|
||||||
|
|
||||||
fn poll_accept(
|
|
||||||
self: Pin<&mut Self>,
|
|
||||||
cx: &mut task::Context<'_>,
|
|
||||||
) -> Poll<Option<Result<Self::Conn, Self::Error>>>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "stream")]
|
#[cfg(feature = "stream")]
|
||||||
|
|
@ -39,12 +34,6 @@ where
|
||||||
{
|
{
|
||||||
type Conn = IO;
|
type Conn = IO;
|
||||||
type Error = E;
|
type Error = E;
|
||||||
fn poll_accept(
|
|
||||||
self: Pin<&mut Self>,
|
|
||||||
cx: &mut task::Context<'_>,
|
|
||||||
) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
FromStream { stream }
|
FromStream { stream }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,15 @@ use super::accept::Accept;
|
||||||
use super::conn::Http as Http_;
|
use super::conn::Http as Http_;
|
||||||
#[cfg(all(feature = "tcp"))]
|
#[cfg(all(feature = "tcp"))]
|
||||||
use super::tcp::AddrIncoming;
|
use super::tcp::AddrIncoming;
|
||||||
use crate::body::{Body};
|
use crate::body::{Body, HttpBody};
|
||||||
use crate::common::exec::Exec;
|
use crate::common::exec::Exec;
|
||||||
use crate::common::exec::{NewSvcExec};
|
use crate::common::exec::{ConnStreamExec, NewSvcExec};
|
||||||
use crate::common::{task, Future, Pin, Poll};
|
use crate::common::{task, Future, Pin, Poll, Unpin};
|
||||||
use crate::service::{HttpService, MakeServiceRef};
|
use crate::service::{HttpService, MakeServiceRef};
|
||||||
use pin_project_lite::pin_project;
|
use pin_project_lite::pin_project;
|
||||||
use std::error::Error as StdError;
|
use std::error::Error as StdError;
|
||||||
|
#[cfg(feature = "tcp")]
|
||||||
|
use tokio::io::{AsyncRead, AsyncWrite};
|
||||||
pub struct Server<I, S, E = Exec> {
|
pub struct Server<I, S, E = Exec> {
|
||||||
incoming: I,
|
incoming: I,
|
||||||
make_service: S,
|
make_service: S,
|
||||||
|
|
@ -90,7 +91,7 @@ where
|
||||||
}
|
}
|
||||||
pub(crate) mod new_svc {
|
pub(crate) mod new_svc {
|
||||||
use super::Watcher;
|
use super::Watcher;
|
||||||
use crate::body::{Body};
|
use crate::body::{Body, HttpBody};
|
||||||
use crate::common::exec::ConnStreamExec;
|
use crate::common::exec::ConnStreamExec;
|
||||||
use crate::common::{task, Future, Pin, Poll};
|
use crate::common::{task, Future, Pin, Poll};
|
||||||
use crate::service::HttpService;
|
use crate::service::HttpService;
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,6 @@ impl AddrIncoming {
|
||||||
impl Accept for AddrIncoming {
|
impl Accept for AddrIncoming {
|
||||||
type Conn = AddrStream;
|
type Conn = AddrStream;
|
||||||
type Error = io::Error;
|
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 {
|
impl fmt::Debug for AddrIncoming {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ where
|
||||||
pub trait MakeServiceRef<Target, ReqBody> {
|
pub trait MakeServiceRef<Target, ReqBody> {
|
||||||
type ResBody;
|
type ResBody;
|
||||||
type Error;
|
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
|
impl<T, Target, E, ME, S, F, IB, OB> MakeServiceRef<Target, IB> for T
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue