mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
Remove lots of 'static bounds
The core trait and associated types no longer require the `'static` bounds, and all associated methods have also had the `'static` bounds removed. The only location for the `'static` bound is `forget`. While the restriction of `'static` on `forget` is here to stay, we'll soon enable `Loop::run` to take a non-`'static` future, allowing driving a non-`'static` future.
This commit is contained in:
parent
8025d85019
commit
9672f90091
@ -195,7 +195,9 @@ impl Loop {
|
||||
/// otherwise waiting for the future to complete.
|
||||
///
|
||||
/// Returns the value that the future resolves to.
|
||||
pub fn run<F: Future>(&mut self, f: F) -> Result<F::Item, F::Error> {
|
||||
pub fn run<F>(&mut self, f: F) -> Result<F::Item, F::Error>
|
||||
where F: Future + 'static,
|
||||
{
|
||||
let (tx_res, rx_res) = mpsc::channel();
|
||||
let handle = self.handle();
|
||||
self.add_loop_data(f.then(move |res| {
|
||||
|
Loading…
x
Reference in New Issue
Block a user