pub struct JoinHandle<T, M: Send + Sync + 'static = (), K: OutputMode = SendOutput> { /* private fields */ }Expand description
唯一结果句柄(result handle),不支持Clone或复制(Copy)。
单次领取Result<T,TaskError>;业务T可以自身是Result,不据此决定控制完成分类。 本地模式不能跨线程;共享ControlHandle不获得本句柄的权限。
Implementations§
§impl<T, M: Send + Sync + 'static, K: OutputMode> JoinHandle<T, M, K>
impl<T, M: Send + Sync + 'static, K: OutputMode> JoinHandle<T, M, K>
§impl<T, M: Send + Sync + 'static, K: OutputMode> JoinHandle<T, M, K>
impl<T, M: Send + Sync + 'static, K: OutputMode> JoinHandle<T, M, K>
pub fn snapshot(&self) -> TaskSnapshot
pub fn snapshot(&self) -> TaskSnapshot
线程安全(thread-safe)地观察当前任务(Task)基本事实,不等同结果已领取。
§impl<T, M: Send + Sync + 'static, K: OutputMode> JoinHandle<T, M, K>
impl<T, M: Send + Sync + 'static, K: OutputMode> JoinHandle<T, M, K>
Trait Implementations§
§impl<T, M: Send + Sync + 'static, K: OutputMode> Drop for JoinHandle<T, M, K>
impl<T, M: Send + Sync + 'static, K: OutputMode> Drop for JoinHandle<T, M, K>
§impl<T, M: Send + Sync + 'static, K: OutputMode> Future for JoinHandle<T, M, K>
impl<T, M: Send + Sync + 'static, K: OutputMode> Future for JoinHandle<T, M, K>
impl<T, M: Send + Sync + 'static, K: OutputMode> Unpin for JoinHandle<T, M, K>
Auto Trait Implementations§
impl<T, M = (), K = SendOutput> !RefUnwindSafe for JoinHandle<T, M, K>
impl<T, M = (), K = SendOutput> !UnwindSafe for JoinHandle<T, M, K>
impl<T, M, K> Forget for JoinHandle<T, M, K>
impl<T, M, K> Freeze for JoinHandle<T, M, K>
impl<T, M, K> Move for JoinHandle<T, M, K>
impl<T, M, K> Send for JoinHandle<T, M, K>
impl<T, M, K> Sync for JoinHandle<T, M, K>
impl<T, M, K> UnsafeUnpin for JoinHandle<T, M, K>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more