@@ -32,37 +32,8 @@ impl<T> Connector<T> {
32
32
bind_addr,
33
33
}
34
34
}
35
-
36
- // /// Set memory pool.
37
- // ///
38
- // /// Use specified memory pool for memory allocations. By default P0
39
- // /// memory pool is used.
40
- // pub fn memory_pool(mut self, id: PoolId) -> Self {
41
- // self.pool = id.pool_ref();
42
- // self
43
- // }
44
35
}
45
36
46
- //impl<T: Address> Connector<T> {
47
- // /// Resolve and connect to remote host
48
- // pub fn connect<U>(&self, message: U) -> impl Future<Output = Result<Io, ConnectError>>
49
- // where
50
- // Connect<T>: From<U>,
51
- // {
52
- // ConnectServiceResponse {
53
- // state: ConnectState::Resolve(self.resolver.call(message.into())),
54
- // bind_addr: self.bind_addr,
55
- // pool: self.pool,
56
- // }
57
- // }
58
- //}
59
-
60
- //impl<T> Default for Connector<T> {
61
- // fn default() -> Self {
62
- // Connector::new(None)
63
- // }
64
- //}
65
-
66
37
impl < T > Clone for Connector < T > {
67
38
fn clone ( & self ) -> Self {
68
39
Connector {
@@ -73,31 +44,6 @@ impl<T> Clone for Connector<T> {
73
44
}
74
45
}
75
46
76
- //impl<T: Address> From<Connector<T>> for IoBoxed {
77
- // fn from(value: Connector<T>) -> Self {
78
- // IoBoxed::from(Io::new(value))
79
- // }
80
- //}
81
- //
82
- //impl<T: Address> IoStream for Connector<T> {
83
- // fn start(self, _read: ReadContext, _write: WriteContext) -> Option<Box<dyn Handle>> {
84
- // let io = Rc::new(RefCell::new(self));
85
- // Some(Box::new(IoBoxedHandleWrapper(io)))
86
- // }
87
- //}
88
-
89
- //impl<T: Address + Debug, C> ServiceFactory<Connect<T>, C> for Connector<T> {
90
- // type Response = Io;
91
- // type Error = ConnectError;
92
- // type Service = Connector<T>;
93
- // type InitError = ();
94
- // type Future = Ready<Self::Service, Self::InitError>;
95
- //
96
- // #[inline]
97
- // fn new_service(&self, _: C) -> Self::Future {
98
- // Ready::Ok(self.clone())
99
- // }
100
- //}
101
47
102
48
impl < T : Address > Service < Connect < T > > for Connector < T > {
103
49
type Response = Io ;
@@ -461,7 +407,7 @@ impl Future for WriteTask {
461
407
type Output = ( ) ;
462
408
463
409
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
464
- let mut this = self . as_mut ( ) . get_mut ( ) ;
410
+ let this = self . as_mut ( ) . get_mut ( ) ;
465
411
466
412
match this. st {
467
413
IoWriteState :: Processing ( ref mut delay) => {
@@ -725,12 +671,4 @@ where
725
671
}
726
672
}
727
673
728
- //struct IoBoxedHandleWrapper<T>(Rc<RefCell<Connector<T>>>);
729
- //
730
- //impl<T> Handle for IoBoxedHandleWrapper<T> {
731
- // fn query(&self, _id: any::TypeId) -> Option<Box<dyn any::Any>> {
732
- // None
733
- // }
734
- //}
735
-
736
674
pub type ReqAddress = String ;
0 commit comments