/// Read a range of data from the blob file into the provided buffers.
///
/// Read data of range [offset, offset + max_size) from the blob file, and returns:
/// - bytes of data read, which may be smaller than max_size
/// - error code if error happens
///
/// It will try `BlobBackend::retry_limit()` times at most and return the first successfully
/// read data.
Read a range of data from the blob file into the provided buffers.
Read data of range [offset, offset + max_size) from the blob file, and returns:
bytes of data read, which may be smaller than max_size
error code if error happens

It will try `BlobBackend::retry_limit()` times at most and return the first successfully
read data.
Read a range of data from the blob file into the provided buffers . Read data of range [ offset offset + max_size ) from the blob file and returns : bytes of data read which may be smaller than max_size error code if error happens It will try ` BlobBackend :: retry_limit () ` times at most and return the first successfully read data .
fn readv(&self, bufs: &[VolatileSlice], offset: u64, max_size: usize) -> BackendResult<usize> {
        if bufs.len() == 1 && max_size >= bufs[0].len() {
            let buf = unsafe { std::slice::from_raw_parts_mut(bufs[0].as_ptr(), bufs[0].len()) };
            self.read(buf, offset)
        } else {
            // Use std::alloc to avoid zeroing the allocated buffer.
            let size = bufs.iter().fold(0usize, move |size, s| size + s.len());
            let size = std::cmp::min(size, max_size);
            let mut data = Vec::with_capacity(size);
            unsafe { data.set_len(size) };
            let result = self.read(&mut data, offset)?;
            copyv(&[&data], bufs, 0, result, 0, 0)
                .map(|r| r.0)
                .map_err(BackendError::CopyData)
        }
    }
fn readv ( & self , bufs : & [ VolatileSlice ] , offset : u64 , max_size : usize ) -> BackendResult < usize > { if bufs . len ( ) == 1 && max_size >= bufs [ 0 ] . len ( ) { let buf = unsafe { std :: slice :: from_raw_parts_mut ( bufs [ 0 ] . as_ptr ( ) , bufs [ 0 ] . len ( ) ) } ; self . read ( buf , offset ) } else { // Use std::alloc to avoid zeroing the allocated buffer. let size = bufs . iter ( ) . fold ( 0usize , move | size , s | size + s . len ( ) ) ; let size = std :: cmp :: min ( size , max_size ) ; let mut data = Vec :: with_capacity ( size ) ; unsafe { data . set_len ( size ) } ; let result = self . read ( & mut data , offset ) ? ; copyv ( & [ & data ] , bufs , 0 , result , 0 , 0 ) . map ( | r | r . 0 ) . map_err ( BackendError :: CopyData ) } }
Read a range of data from the blob file into the provided buffers.
Read a range of data from the blob file into the provided buffers .
&self
bufs
&[VolatileSlice]
offset
u64
max_size
usize