Struct tokio::runtime::scheduler::current_thread::CurrentThread
source · pub(crate) struct CurrentThread {
core: AtomicCell<Core>,
notify: Notify,
}
Expand description
Executes tasks on the current thread
Fields§
§core: AtomicCell<Core>
Core scheduler data is acquired by a thread entering block_on
.
notify: Notify
Notifier for waking up other threads to steal the driver.
Implementations§
source§impl CurrentThread
impl CurrentThread
pub(crate) fn new( driver: Driver, driver_handle: Handle, blocking_spawner: Spawner, seed_generator: RngSeedGenerator, config: Config, local_tid: Option<ThreadId>, ) -> (CurrentThread, Arc<Handle>)
pub(crate) fn block_on<F: Future>( &self, handle: &Handle, future: F, ) -> F::Output
fn take_core(&self, handle: &Arc<Handle>) -> Option<CoreGuard<'_>>
pub(crate) fn shutdown(&mut self, handle: &Handle)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CurrentThread
impl RefUnwindSafe for CurrentThread
impl Send for CurrentThread
impl Sync for CurrentThread
impl Unpin for CurrentThread
impl !UnwindSafe for CurrentThread
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