pub fn submit(&mut self) -> io::Result<usize> {
        // Get the current batch and clear out the new one
        let mut iocbp = self.batch.batch();

        if iocbp.len() == 0 {
            Ok(0)
        } else {
            let r = unsafe { aio::io_submit(self.ctx.ctx, iocbp.len() as i64, iocbp.as_mut_ptr()) };

            if r < 0 {
                Err(io::Error::from_raw_os_error(-r))
            } else {
                let ru = r as usize;

                // XXX need a Vec method to remove a range
                for _ in 0..r {
                    if iocbp.remove(0).is_null() {
                        break;
                    }
                }
                self.submitted += ru;

                Ok(ru)
            }
        }
    }
/// Submit all outstanding IO operations. Returns number of submitted operations.
Submit all outstanding IO operations. Returns number of submitted operations.
Submit all outstanding IO operations . Returns number of submitted operations .
pub fn submit(&mut self) -> io::Result<usize> {
        // Get the current batch and clear out the new one
        let mut iocbp = self.batch.batch();
        if iocbp.len() == 0 {
            Ok(0)
        } else {
            let r = unsafe { aio::io_submit(self.ctx.ctx, iocbp.len() as i64, iocbp.as_mut_ptr()) };
            if r < 0 {
                Err(io::Error::from_raw_os_error(-r))
            } else {
                let ru = r as usize;
                // XXX need a Vec method to remove a range
                for _ in 0..r {
                    if iocbp.remove(0).is_null() {
                        break;
                    }
                }
                self.submitted += ru;
                Ok(ru)
            }
        }
    }
pub fn submit ( & mut self ) -> io :: Result < usize > { // Get the current batch and clear out the new one let mut iocbp = self . batch . batch ( ) ; if iocbp . len ( ) == 0 { Ok ( 0 ) } else { let r = unsafe { aio :: io_submit ( self . ctx . ctx , iocbp . len ( ) as i64 , iocbp . as_mut_ptr ( ) ) } ; if r < 0 { Err ( io :: Error :: from_raw_os_error ( - r ) ) } else { let ru = r as usize ; // XXX need a Vec method to remove a range for _ in 0 .. r { if iocbp . remove ( 0 ) . is_null ( ) { break ; } } self . submitted += ru ; Ok ( ru ) } } }
Submit all outstanding IO operations.
Submit all outstanding IO operations .
&mut self
&mut self