fn new<F>(f: F, stack_size: usize, id: TaskId, task_type: TaskType, name: Option<String>) -> Self
    where
        F: FnOnce() + Send + 'static,
    {
        let mut continuation = ContinuationPool::acquire(stack_size);
        continuation.initialize(Box::new(f));
        let waker = make_waker(id);
        let continuation = Rc::new(RefCell::new(continuation));
        Self {
            id,
            state: TaskState::Runnable,
            task_type,
            continuation,
            waiter: None,
            waker,
            woken_by_self: false,
            name,
        }
    }
/// Create a task from a continuation
Create a task from a continuation
Create a task from a continuation
fn new<F>(f: F, stack_size: usize, id: TaskId, task_type: TaskType, name: Option<String>) -> Self
    where
        F: FnOnce() + Send + 'static,
    {
        let mut continuation = ContinuationPool::acquire(stack_size);
        continuation.initialize(Box::new(f));
        let waker = make_waker(id);
        let continuation = Rc::new(RefCell::new(continuation));
        Self {
            id,
            state: TaskState::Runnable,
            task_type,
            continuation,
            waiter: None,
            waker,
            woken_by_self: false,
            name,
        }
    }
fn new < F > ( f : F , stack_size : usize , id : TaskId , task_type : TaskType , name : Option < String > ) -> Self where F : FnOnce ( ) + Send + ' static , { let mut continuation = ContinuationPool :: acquire ( stack_size ) ; continuation . initialize ( Box :: new ( f ) ) ; let waker = make_waker ( id ) ; let continuation = Rc :: new ( RefCell :: new ( continuation ) ) ; Self { id , state : TaskState :: Runnable , task_type , continuation , waiter : None , waker , woken_by_self : false , name , } }
Create a task from a continuation
Create a task from a continuation
f
F
stack_size
usize
id
TaskId
task_type
TaskType
name
Option<String>
f
F
stack_size
usize
id
TaskId
task_type
TaskType
name
Option<String>