fn parse(elem: &Element) -> Result<Request> {
        let mut request = Request {
            desc_index: elem.index,
            elem_cnt: 0u32,
            iovec: Vec::new(),
        };
        if elem.out_iovec.is_empty() {
            return Err(ErrorKind::ElementEmpty.into());
        } else {
            let elem_iov = elem.out_iovec.get(0).unwrap();
            request.iovec.push(Iovec {
                iov_base: elem_iov.addr,
                iov_len: elem_iov.len as u64,
            });
            request.elem_cnt += elem_iov.len;
        }
        Ok(request)
    }
/// Parse the request from virtio queue.
/// Return the request from qirtio queue.
///
/// # Arguments
///
/// * `elem` - Available ring.
Parse the request from virtio queue.
Return the request from qirtio queue.
Parse the request from virtio queue . Return the request from qirtio queue .
fn parse(elem: &Element) -> Result<Request> {
        let mut request = Request {
            desc_index: elem.index,
            elem_cnt: 0u32,
            iovec: Vec::new(),
        };
        if elem.out_iovec.is_empty() {
            return Err(ErrorKind::ElementEmpty.into());
        } else {
            let elem_iov = elem.out_iovec.get(0).unwrap();
            request.iovec.push(Iovec {
                iov_base: elem_iov.addr,
                iov_len: elem_iov.len as u64,
            });
            request.elem_cnt += elem_iov.len;
        }
        Ok(request)
    }
fn parse ( elem : & Element ) -> Result < Request > { let mut request = Request { desc_index : elem . index , elem_cnt : 0u32 , iovec : Vec :: new ( ) , } ; if elem . out_iovec . is_empty ( ) { return Err ( ErrorKind :: ElementEmpty . into ( ) ) ; } else { let elem_iov = elem . out_iovec . get ( 0 ) . unwrap ( ) ; request . iovec . push ( Iovec { iov_base : elem_iov . addr , iov_len : elem_iov . len as u64 , } ) ; request . elem_cnt += elem_iov . len ; } Ok ( request ) }
Parse the request from virtio queue.
Parse the request from virtio queue .
elem
&Element
elem
&Element