/// Queue up a pwritev operation.
Queue up a pwritev operation.
Queue up a pwritev operation .
pub fn pwritev<F: AsRawFd>(&mut self, file: &F, bufv: Vec<Wb>, off: Offset, tok: T) -> Result<(), (Vec<Wb>, T)> {
        if self.full() {
            Err((bufv, tok))
        } else {
            let iov : Vec<_> = (0..bufv.len())
                .map(|b| aio::Struct_iovec { iov_base: bufv[b].wrbuf().as_ptr() as *mut u8,
                                             iov_len: bufv[b].wrbuf().len() as u64 })
                .collect();
            let iocb = Iocb {
                iocb: aio::Struct_iocb {
                    aio_buf: iov.as_ptr() as u64,
                    aio_count: iov.len() as u64,
                    .. self.pack_iocb(aio::Iocmd::IO_CMD_PWRITEV, file, off)
                },
                op: IoOp::Pwritev(bufv, tok),
            };
            self.prep_iocb(iocb)
        }
    }
pub fn pwritev < F : AsRawFd > ( & mut self , file : & F , bufv : Vec < Wb > , off : Offset , tok : T ) -> Result < ( ) , ( Vec < Wb > , T ) > { if self . full ( ) { Err ( ( bufv , tok ) ) } else { let iov : Vec < _ > = ( 0 .. bufv . len ( ) ) . map ( | b | aio :: Struct_iovec { iov_base : bufv [ b ] . wrbuf ( ) . as_ptr ( ) as * mut u8 , iov_len : bufv [ b ] . wrbuf ( ) . len ( ) as u64 } ) . collect ( ) ; let iocb = Iocb { iocb : aio :: Struct_iocb { aio_buf : iov . as_ptr ( ) as u64 , aio_count : iov . len ( ) as u64 , .. self . pack_iocb ( aio :: Iocmd :: IO_CMD_PWRITEV , file , off ) } , op : IoOp :: Pwritev ( bufv , tok ) , } ; self . prep_iocb ( iocb ) } }
Queue up a pwritev operation.
Queue up a pwritev operation .
&mut self
file
&F
bufv
Vec<Wb>
off
Offset
tok
T