1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-28 11:47:47 +02:00

add clone impls

This commit is contained in:
Nikolay Kim
2018-08-27 20:32:49 -07:00
parent ddfe1322a1
commit f9b9031af2
2 changed files with 28 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ use std::collections::VecDeque;
use std::io;
use std::net::SocketAddr;
use futures::{Async, Future, Poll};
use futures::{Async, Future, Poll, future::ok};
use tokio;
use tokio_tcp::{ConnectFuture, TcpStream};
use tower_service::Service;
@@ -47,6 +47,18 @@ impl Connector {
Connector { resolver }
}
pub fn new_service<E>() -> impl Future<Item=Connector, Error=E> {
ok(Connector::new())
}
}
impl Clone for Connector {
fn clone(&self) -> Self {
Connector {
resolver: self.resolver.clone(),
}
}
}
impl Service for Connector {