Struct tokio::runtime::scheduler::multi_thread::MultiThread
source · pub(crate) struct MultiThread;
Expand description
Work-stealing based thread pool for executing futures.
Implementations§
source§impl MultiThread
impl MultiThread
pub(crate) fn new( size: usize, driver: Driver, driver_handle: Handle, blocking_spawner: Spawner, seed_generator: RngSeedGenerator, config: Config, ) -> (MultiThread, Arc<Handle>, Launch)
sourcepub(crate) fn block_on<F>(&self, handle: &Handle, future: F) -> F::Outputwhere
F: Future,
pub(crate) fn block_on<F>(&self, handle: &Handle, future: F) -> F::Outputwhere
F: Future,
Blocks the current thread waiting for the future to complete.
The future will execute on the current thread, but all spawned tasks will be executed on the thread pool.
pub(crate) fn shutdown(&mut self, handle: &Handle)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiThread
impl RefUnwindSafe for MultiThread
impl Send for MultiThread
impl Sync for MultiThread
impl Unpin for MultiThread
impl UnwindSafe for MultiThread
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