pub struct Handle { /* private fields */ }Expand description
Spawning handle for the runtime 运行时的生成句柄
Provides access to runtime functionality from within tasks. 从任务内部提供运行时功能访问。
Implementations§
Source§impl Handle
impl Handle
Sourcepub fn current() -> Self
pub fn current() -> Self
Get a handle to the current runtime 获取当前运行时的句柄
§Panics / 恐慌
Panics if called outside of a runtime context. 如果在运行时上下文之外调用则恐慌。
Sourcepub fn try_current() -> Option<Self>
pub fn try_current() -> Option<Self>
Try to get a handle to the current runtime. Returns None if outside a runtime. 尝试获取当前运行时的句柄。如果在运行时外部则返回None。
Sourcepub fn scheduler(&self) -> &SchedulerHandle
pub fn scheduler(&self) -> &SchedulerHandle
Get the scheduler handle 获取调度器句柄
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Handle
impl !UnwindSafe for Handle
impl Freeze for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
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