Skip to main content

create

Function create 

pub fn create<F, S, M>(
    future: F,
    schedule: S,
    metadata: M,
    options: TaskOptions,
) -> RawResult<TaskParts<F::Output, M, SendOutput>, BuildError<F, S, M>>
where F: Future + Send + 'static, F::Output: Send + 'static, S: Schedule, M: Send + Sync + 'static,
Expand description

创建可跨线程提交的任务(Task);输入及输出必须满足Send。 分配失败返还原输入;没有同步poll、隐式提交或运行时依赖。