Add lifetime to FutureObj
This commit is contained in:
parent
9f70e7fe3c
commit
d8bf222367
8 changed files with 60 additions and 39 deletions
|
|
@ -19,9 +19,10 @@ use std::sync::{
|
|||
Arc,
|
||||
atomic::{self, AtomicUsize},
|
||||
};
|
||||
use std::future::FutureObj;
|
||||
use std::task::{
|
||||
Context, Poll, Wake,
|
||||
Executor, FutureObj, SpawnObjError,
|
||||
Executor, SpawnObjError,
|
||||
local_waker_from_nonlocal,
|
||||
};
|
||||
|
||||
|
|
@ -37,7 +38,7 @@ impl Wake for Counter {
|
|||
|
||||
struct NoopExecutor;
|
||||
impl Executor for NoopExecutor {
|
||||
fn spawn_obj(&mut self, _: FutureObj<T>) -> Result<(), SpawnObjError> {
|
||||
fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ use std::sync::{
|
|||
Arc,
|
||||
atomic::{self, AtomicUsize},
|
||||
};
|
||||
use std::future::FutureObj;
|
||||
use std::task::{
|
||||
Context, Poll,
|
||||
Wake, Waker, LocalWaker,
|
||||
Executor, FutureObj, SpawnObjError,
|
||||
Executor, SpawnObjError,
|
||||
local_waker, local_waker_from_nonlocal,
|
||||
};
|
||||
|
||||
|
|
@ -44,7 +45,7 @@ impl Wake for Counter {
|
|||
struct NoopExecutor;
|
||||
|
||||
impl Executor for NoopExecutor {
|
||||
fn spawn_obj(&mut self, _: FutureObj<()>) -> Result<(), SpawnObjError> {
|
||||
fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue