fn drain(&self) {
        let maybe_realloc_capacity = self.estimate_realloc_capacity();

        // Poll all the pending tasks
        while let Some(task) = self.pop_task() {
            task.poll();
        }

        if let Some(realloc_capacity) = maybe_realloc_capacity {
            // We decided to reclaim some space
            *self.microtask_queue.borrow_mut() = VecDeque::with_capacity(realloc_capacity);
        }
    }
// Poll the queue until it is empty
Poll the queue until it is empty
Poll the queue until it is empty
fn drain(&self) {
        let maybe_realloc_capacity = self.estimate_realloc_capacity();
        // Poll all the pending tasks
        while let Some(task) = self.pop_task() {
            task.poll();
        }
        if let Some(realloc_capacity) = maybe_realloc_capacity {
            // We decided to reclaim some space
            *self.microtask_queue.borrow_mut() = VecDeque::with_capacity(realloc_capacity);
        }
    }
fn drain ( & self ) { let maybe_realloc_capacity = self . estimate_realloc_capacity ( ) ; // Poll all the pending tasks while let Some ( task ) = self . pop_task ( ) { task . poll ( ) ; } if let Some ( realloc_capacity ) = maybe_realloc_capacity { // We decided to reclaim some space * self . microtask_queue . borrow_mut ( ) = VecDeque :: with_capacity ( realloc_capacity ) ; } }
Poll the queue until it is empty
Poll the queue until it is empty
&self
&self