mirror of
https://github.com/fafhrd91/actix-net
synced 2025-01-31 09:12:08 +01:00
add impl Service for Rc<RefCell<S>>
This commit is contained in:
parent
1441355d4f
commit
feac0b43d9
@ -1,5 +1,12 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.3.5] - 2019-04-xx
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Add `impl<S: Service> Service for Rc<RefCell<S>>`
|
||||||
|
|
||||||
|
|
||||||
## [0.3.4] - 2019-03-12
|
## [0.3.4] - 2019-03-12
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
use std::cell::RefCell;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
@ -391,6 +392,24 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<S> Service for Rc<RefCell<S>>
|
||||||
|
where
|
||||||
|
S: Service,
|
||||||
|
{
|
||||||
|
type Request = S::Request;
|
||||||
|
type Response = S::Response;
|
||||||
|
type Error = S::Error;
|
||||||
|
type Future = S::Future;
|
||||||
|
|
||||||
|
fn poll_ready(&mut self) -> Poll<(), S::Error> {
|
||||||
|
self.borrow_mut().poll_ready()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn call(&mut self, request: Self::Request) -> S::Future {
|
||||||
|
self.borrow_mut().call(request)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<S, C> NewService<C> for Rc<S>
|
impl<S, C> NewService<C> for Rc<S>
|
||||||
where
|
where
|
||||||
S: NewService<C>,
|
S: NewService<C>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user