pub fn write(&self, src: &mut dyn std::io::Read, addr: GuestAddress, count: u64) -> Result<()> {
        let view = self.flat_view.load();
        let (fr, offset) = view
            .find_flatrange(addr)
            .map(|fr| (fr, addr.offset_from(fr.addr_range.base)))
            .chain_err(|| ErrorKind::RegionNotFound(addr.raw_value()))?;

        let region_base = fr.addr_range.base.unchecked_sub(fr.offset_in_region);
        let offset_in_region = fr.offset_in_region + offset;
        fr.owner
            .write(src, region_base, offset_in_region, count)
            .chain_err(||
                format!(
                    "Failed to write region, region base 0x{:X}, offset in region 0x{:X}, size 0x{:X}",
                    region_base.raw_value(),
                    offset_in_region,
                    count
                ))
    }
/// Write data to specified guest address.
///
/// # Arguments
///
/// * `src` - Data buffer to write.
/// * `addr` - Start address.
/// * `count` - Size of data.
///
/// # Errors
///
/// Return Error if the `addr` is not mapped.
Write data to specified guest address.
Write data to specified guest address .
pub fn write(&self, src: &mut dyn std::io::Read, addr: GuestAddress, count: u64) -> Result<()> {
        let view = self.flat_view.load();
        let (fr, offset) = view
            .find_flatrange(addr)
            .map(|fr| (fr, addr.offset_from(fr.addr_range.base)))
            .chain_err(|| ErrorKind::RegionNotFound(addr.raw_value()))?;
        let region_base = fr.addr_range.base.unchecked_sub(fr.offset_in_region);
        let offset_in_region = fr.offset_in_region + offset;
        fr.owner
            .write(src, region_base, offset_in_region, count)
            .chain_err(||
                format!(
                    "Failed to write region, region base 0x{:X}, offset in region 0x{:X}, size 0x{:X}",
                    region_base.raw_value(),
                    offset_in_region,
                    count
                ))
    }
pub fn write ( & self , src : & mut dyn std :: io :: Read , addr : GuestAddress , count : u64 ) -> Result < ( ) > { let view = self . flat_view . load ( ) ; let ( fr , offset ) = view . find_flatrange ( addr ) . map ( | fr | ( fr , addr . offset_from ( fr . addr_range . base ) ) ) . chain_err ( | | ErrorKind :: RegionNotFound ( addr . raw_value ( ) ) ) ? ; let region_base = fr . addr_range . base . unchecked_sub ( fr . offset_in_region ) ; let offset_in_region = fr . offset_in_region + offset ; fr . owner . write ( src , region_base , offset_in_region , count ) . chain_err ( | | format ! ( " " region_base raw_value ( ) offset_in_region count ) ) }
Write data to specified guest address.
Write data to specified guest address .
&self
src
&mut dyn std::io::Read
addr
GuestAddress
count
u64
&self
src
&mut dyn std::io::Read
addr
GuestAddress
count
u64
errors
Return Error if the `addr` is not mapped.
Return Error if the ` addr ` is not mapped .