pub(crate) fn read(self, buf: &mut [u8]) -> usize {
        // compute len to read
        let len = std::cmp::min(buf.len(), self.data.len() - self.offset as usize);
        // get downloaded data
        buf[0..len]
            .clone_from_slice(&self.data[self.offset as usize..(self.offset as usize + len)]);
        len
    }
/// Consumes self as RangeCursor is read only once
Consumes self as RangeCursor is read only once
Consumes self as RangeCursor is read only once
pub(crate) fn read(self, buf: &mut [u8]) -> usize {
        // compute len to read
        let len = std::cmp::min(buf.len(), self.data.len() - self.offset as usize);
        // get downloaded data
        buf[0..len]
            .clone_from_slice(&self.data[self.offset as usize..(self.offset as usize + len)]);
        len
    }
pub ( crate ) fn read ( self , buf : & mut [ u8 ] ) -> usize { // compute len to read let len = std :: cmp :: min ( buf . len ( ) , self . data . len ( ) - self . offset as usize ) ; // get downloaded data buf [ 0 .. len ] . clone_from_slice ( & self . data [ self . offset as usize .. ( self . offset as usize + len ) ] ) ; len }
Consumes self as RangeCursor is read only once
Consumes self as RangeCursor is read only once
self
buf
&mut [u8]
self
buf
&mut [u8]