/// PollResult the future. If it is not ready, dispatch available packets and possibly try again.
/// Timers will not fire. Never blocks.
///
/// This function is for testing. DO NOT use this function in tests or applications that
/// involve any interaction with other threads or processes, as those interactions
/// may become stalled waiting for signals from "the outside world" which is beyond
/// the knowledge of the executor.
///
/// Unpin: this function requires all futures to be `Unpin`able, so any `!Unpin`
/// futures must first be pinned using the `pin_mut!` macro from the `pin-utils` crate.


This function is for testing. DO NOT use this function in tests or applications that
involve any interaction with other threads or processes, as those interactions
may become stalled waiting for signals from "the outside world" which is beyond
the knowledge of the executor.


This function is for testing . DO NOT use this function in tests or applications that involve any interaction with other threads or processes as those interactions may become stalled waiting for signals from " the outside world " which is beyond the knowledge of the executor .
pub fn run_until_stalled<F>(&mut self, main_future: &mut F) -> Poll<F::Output>
    where
        F: Future + Unpin,
    {
        let waker = self.singlethreaded_main_task_wake();
        let main_cx = &mut Context::from_waker(&waker);
        let mut res = main_future.poll_unpin(main_cx);
        loop {
            if res.is_ready() {
                return res;
            }
            let packet = match self.inner.port.wait(zx::Time::from_nanos(0)) {
                Ok(packet) => packet,
                Err(zx::Status::TIMED_OUT) => return Poll::Pending,
                Err(status) => panic!("Error calling port wait: {:?}", status),
            };
            match packet.key() {
                EMPTY_WAKEUP_ID => {
                    res = main_future.poll_unpin(main_cx);
                }
                TASK_READY_WAKEUP_ID => self.inner.poll_ready_tasks(),
                receiver_key => {
                    self.inner.deliver_packet(receiver_key as usize, packet);
                }
            }
        }
    }
pub fn run_until_stalled < F > ( & mut self , main_future : & mut F ) -> Poll < F :: Output > where F : Future + Unpin , { let waker = self . singlethreaded_main_task_wake ( ) ; let main_cx = & mut Context :: from_waker ( & waker ) ; let mut res = main_future . poll_unpin ( main_cx ) ; loop { if res . is_ready ( ) { return res ; } let packet = match self . inner . port . wait ( zx :: Time :: from_nanos ( 0 ) ) { Ok ( packet ) => packet , Err ( zx :: Status :: TIMED_OUT ) => return Poll :: Pending , Err ( status ) => panic ! ( " " status ) , } ; match packet . key ( ) { EMPTY_WAKEUP_ID => { res = main_future . poll_unpin ( main_cx ) ; } TASK_READY_WAKEUP_ID => self . inner . poll_ready_tasks ( ) , receiver_key => { self . inner . deliver_packet ( receiver_key as usize , packet ) ; } } } }
PollResult the future.
PollResult the future .
&mut self
main_future
&mut F