pub fn read_memory(&self, vaddr: usize, buf: &mut [u8]) -> ZxResult<usize> {
        // TODO: support multiple VMOs
        let map = self.find_mapping(vaddr).ok_or(ZxError::NO_MEMORY)?;
        let map_inner = map.inner.lock();
        let vmo_offset = vaddr - map_inner.addr + map_inner.vmo_offset;
        let size_limit = map_inner.addr + map_inner.size - vaddr;
        let actual_size = buf.len().min(size_limit);
        map.vmo.read(vmo_offset, &mut buf[0..actual_size])?;
        Ok(actual_size)
    }
/// Read from address space.
///
/// Return the actual number of bytes read.
Read from address space.
Return the actual number of bytes read.
Read from address space . Return the actual number of bytes read .
pub fn read_memory(&self, vaddr: usize, buf: &mut [u8]) -> ZxResult<usize> {
        // TODO: support multiple VMOs
        let map = self.find_mapping(vaddr).ok_or(ZxError::NO_MEMORY)?;
        let map_inner = map.inner.lock();
        let vmo_offset = vaddr - map_inner.addr + map_inner.vmo_offset;
        let size_limit = map_inner.addr + map_inner.size - vaddr;
        let actual_size = buf.len().min(size_limit);
        map.vmo.read(vmo_offset, &mut buf[0..actual_size])?;
        Ok(actual_size)
    }
pub fn read_memory ( & self , vaddr : usize , buf : & mut [ u8 ] ) -> ZxResult < usize > { // TODO: support multiple VMOs let map = self . find_mapping ( vaddr ) . ok_or ( ZxError :: NO_MEMORY ) ? ; let map_inner = map . inner . lock ( ) ; let vmo_offset = vaddr - map_inner . addr + map_inner . vmo_offset ; let size_limit = map_inner . addr + map_inner . size - vaddr ; let actual_size = buf . len ( ) . min ( size_limit ) ; map . vmo . read ( vmo_offset , & mut buf [ 0 .. actual_size ] ) ? ; Ok ( actual_size ) }
Read from address space.
Read from address space .
&self
vaddr
usize
buf
&mut [u8]
&self
vaddr
usize
buf
&mut [u8]