pub fn read_at(&self, dst: &mut [u8], length: usize, offset: usize) -> Result<usize, String> {
    if offset + length > self.capacity() {
      return Err("dst buffer no more space to read".to_string());
    }

    unsafe {
      std::ptr::copy(self.raw_data().add(offset), dst.as_ptr() as *mut u8, length);
      return Ok(length)
    }
  }
/// Read data from the buffer, if there is not enough data in the buffer, an error will be returned
Read data from the buffer, if there is not enough data in the buffer, an error will be returned
Read data from the buffer if there is not enough data in the buffer an error will be returned
pub fn read_at(&self, dst: &mut [u8], length: usize, offset: usize) -> Result<usize, String> {
    if offset + length > self.capacity() {
      return Err("dst buffer no more space to read".to_string());
    }
    unsafe {
      std::ptr::copy(self.raw_data().add(offset), dst.as_ptr() as *mut u8, length);
      return Ok(length)
    }
  }
pub fn read_at ( & self , dst : & mut [ u8 ] , length : usize , offset : usize ) -> Result < usize , String > { if offset + length > self . capacity ( ) { return Err ( " " . to_string ( ) ) ; } unsafe { std :: ptr :: copy ( self . raw_data ( ) . add ( offset ) , dst . as_ptr ( ) as * mut u8 , length ) ; return Ok ( length ) } }
Read data from the buffer, if there is not enough data in the buffer, an error will be returned
Read data from the buffer if there is not enough data in the buffer an error will be returned
&self
dst
&mut [u8]
length
usize
offset
usize