From 0fdac3830746eb4aab7245411c1d581f84de7922 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 12 Mar 2019 16:48:29 -0700 Subject: [PATCH] add constraint --- actix-server/src/builder.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/actix-server/src/builder.rs b/actix-server/src/builder.rs index 99f2754f..6fa2e9ce 100644 --- a/actix-server/src/builder.rs +++ b/actix-server/src/builder.rs @@ -2,6 +2,7 @@ use std::time::Duration; use std::{io, mem, net}; use actix_rt::{spawn, Arbiter, System}; +use actix_service::NewService; use futures::future::{lazy, ok}; use futures::stream::futures_unordered; use futures::sync::mpsc::{unbounded, UnboundedReceiver}; @@ -9,6 +10,7 @@ use futures::{Async, Future, Poll, Stream}; use log::{error, info}; use net2::TcpBuilder; use num_cpus; +use tokio_tcp::TcpStream; use tokio_timer::sleep; use crate::accept::{AcceptLoop, AcceptNotify, Command}; @@ -17,7 +19,7 @@ use crate::service_config::{ConfiguredService, ServiceConfig}; use crate::services::{InternalServiceFactory, ServiceFactory, StreamNewService}; use crate::signals::{Signal, Signals}; use crate::worker::{self, Worker, WorkerAvailability, WorkerClient}; -use crate::{ssl, Token}; +use crate::{ssl, Io, ServerConfig, Token}; /// Server builder pub struct ServerBuilder { @@ -164,6 +166,7 @@ impl ServerBuilder { pub fn bind>(mut self, name: N, addr: U, factory: F) -> io::Result where F: ServiceFactory, + F::NewService: NewService>, U: net::ToSocketAddrs, { let sockets = bind_addr(addr, self.backlog)?;