// The main state machine for an upload:
// - Submits on the transfer queue and waits
// - Submits on the graphics queue and waits
//
// Calls upload_op.complete() or upload_op.error() as appropriate
The main state machine for an upload:
Submits on the transfer queue and waits
Submits on the graphics queue and waits


The main state machine for an upload : Submits on the transfer queue and waits Submits on the graphics queue and waits
pub fn poll_load(&mut self) -> InProgressUploadBatchPollResult {
        loop {
            if let Some(mut inner) = self.take_inner() {
                match inner.upload.state() {
                    Ok(state) => match state {
                        RafxTransferUploadState::Writable => {
                            //log::trace!("RafxTransferUploadState::Writable");
                            inner.upload.submit_transfer().unwrap();
                            self.inner = Some(inner);
                        }
                        RafxTransferUploadState::SentToTransferQueue => {
                            //log::trace!("RafxTransferUploadState::SentToTransferQueue");
                            self.inner = Some(inner);
                            break InProgressUploadBatchPollResult::Pending;
                        }
                        RafxTransferUploadState::PendingSubmitDstQueue => {
                            //log::trace!("RafxTransferUploadState::PendingSubmitDstQueue");
                            inner.upload.submit_dst().unwrap();
                            self.inner = Some(inner);
                        }
                        RafxTransferUploadState::SentToDstQueue => {
                            //log::trace!("RafxTransferUploadState::SentToDstQueue");
                            self.inner = Some(inner);
                            break InProgressUploadBatchPollResult::Pending;
                        }
                        RafxTransferUploadState::Complete => {
                            //log::trace!("RafxTransferUploadState::Complete");
                            for in_flight_upload in inner.in_flight_uploads {
                                in_flight_upload.complete();
                            }
                            break InProgressUploadBatchPollResult::Complete;
                        }
                    },
                    Err(err) => {
                        for in_flight_upload in inner.in_flight_uploads {
                            in_flight_upload.error(err.clone());
                        }
                        break InProgressUploadBatchPollResult::Error;
                    }
                }
            } else {
                break InProgressUploadBatchPollResult::Destroyed;
            }
        }
    }
pub fn poll_load ( & mut self ) -> InProgressUploadBatchPollResult { loop { if let Some ( mut inner ) = self . take_inner ( ) { match inner . upload . state ( ) { Ok ( state ) => match state { RafxTransferUploadState :: Writable => { //log::trace!("RafxTransferUploadState::Writable"); inner . upload . submit_transfer ( ) . unwrap ( ) ; self . inner = Some ( inner ) ; } RafxTransferUploadState :: SentToTransferQueue => { //log::trace!("RafxTransferUploadState::SentToTransferQueue"); self . inner = Some ( inner ) ; break InProgressUploadBatchPollResult :: Pending ; } RafxTransferUploadState :: PendingSubmitDstQueue => { //log::trace!("RafxTransferUploadState::PendingSubmitDstQueue"); inner . upload . submit_dst ( ) . unwrap ( ) ; self . inner = Some ( inner ) ; } RafxTransferUploadState :: SentToDstQueue => { //log::trace!("RafxTransferUploadState::SentToDstQueue"); self . inner = Some ( inner ) ; break InProgressUploadBatchPollResult :: Pending ; } RafxTransferUploadState :: Complete => { //log::trace!("RafxTransferUploadState::Complete"); for in_flight_upload in inner . in_flight_uploads { in_flight_upload . complete ( ) ; } break InProgressUploadBatchPollResult :: Complete ; } } , Err ( err ) => { for in_flight_upload in inner . in_flight_uploads { in_flight_upload . error ( err . clone ( ) ) ; } break InProgressUploadBatchPollResult :: Error ; } } } else { break InProgressUploadBatchPollResult :: Destroyed ; } } }
The main state machine for an upload:
 Submits on the transfer queue and waits
 Submits on the graphics queue and waits
The main state machine for an upload : Submits on the transfer queue and waits Submits on the graphics queue and waits
&mut self