pub(crate) async fn next(&mut self) -> anyhow::Result<Response> {
        let handle = self
            .handle
            .as_ref()
            .expect("WorkerResponses is polled after finish");
        let res = handle.worker.recv().await;
        let is_eos = match &res {
            Ok(ok) => matches!(ok, Response::JudgeDone(_)),
            Err(_) => true,
        };
        if is_eos {
            if res.is_ok() {
                handle.worker.state.store(WorkerStateKind::Locked);
            } else {
                handle.worker.state.store(WorkerStateKind::Crash);
            }
            self.handle.take();
        }
        res
    }
/// Returns next response.
/// If returned response is JudgeDone or error, must not be polled again.
Returns next response.
If returned response is JudgeDone or error, must not be polled again.
Returns next response . If returned response is JudgeDone or error must not be polled again .
pub(crate) async fn next(&mut self) -> anyhow::Result<Response> {
        let handle = self
            .handle
            .as_ref()
            .expect("WorkerResponses is polled after finish");
        let res = handle.worker.recv().await;
        let is_eos = match &res {
            Ok(ok) => matches!(ok, Response::JudgeDone(_)),
            Err(_) => true,
        };
        if is_eos {
            if res.is_ok() {
                handle.worker.state.store(WorkerStateKind::Locked);
            } else {
                handle.worker.state.store(WorkerStateKind::Crash);
            }
            self.handle.take();
        }
        res
    }
pub ( crate ) async fn next ( & mut self ) -> anyhow :: Result < Response > { let handle = self . handle . as_ref ( ) . expect ( " " ) ; let res = handle . worker . recv ( ) . await ; let is_eos = match & res { Ok ( ok ) => matches ! ( ok Response JudgeDone ( ) ) , Err ( _ ) => true , } ; if is_eos { if res . is_ok ( ) { handle . worker . state . store ( WorkerStateKind :: Locked ) ; } else { handle . worker . state . store ( WorkerStateKind :: Crash ) ; } self . handle . take ( ) ; } res }
Returns next response.
Returns next response .
&mut self