fn restore(
        file: &File,
        state: &GuestMemoryState,
        track_dirty_pages: bool,
    ) -> std::result::Result<Self, Error> {
        vm_memory::create_guest_memory(
            &state
                .regions
                .iter()
                .map(|r| {
                    (
                        Some(FileOffset::new(file.try_clone().unwrap(), r.offset)),
                        GuestAddress(r.base_address),
                        r.size,
                    )
                })
                .collect::<Vec<_>>(),
            track_dirty_pages,
        )
        .map_err(Error::CreateMemory)
    }
/// Creates a GuestMemoryMmap given a `file` containing the data
/// and a `state` containing mapping information.
Creates a GuestMemoryMmap given a `file` containing the data
and a `state` containing mapping information.
Creates a GuestMemoryMmap given a ` file ` containing the data and a ` state ` containing mapping information .
fn restore(
        file: &File,
        state: &GuestMemoryState,
        track_dirty_pages: bool,
    ) -> std::result::Result<Self, Error> {
        vm_memory::create_guest_memory(
            &state
                .regions
                .iter()
                .map(|r| {
                    (
                        Some(FileOffset::new(file.try_clone().unwrap(), r.offset)),
                        GuestAddress(r.base_address),
                        r.size,
                    )
                })
                .collect::<Vec<_>>(),
            track_dirty_pages,
        )
        .map_err(Error::CreateMemory)
    }
fn restore ( file : & File , state : & GuestMemoryState , track_dirty_pages : bool , ) -> std :: result :: Result < Self , Error > { vm_memory :: create_guest_memory ( & state . regions . iter ( ) . map ( | r | { ( Some ( FileOffset :: new ( file . try_clone ( ) . unwrap ( ) , r . offset ) ) , GuestAddress ( r . base_address ) , r . size , ) } ) . collect :: < Vec < _ > > ( ) , track_dirty_pages , ) . map_err ( Error :: CreateMemory ) }
Creates a GuestMemoryMmap given a `file` containing the data
and a `state` containing mapping information.
Creates a GuestMemoryMmap given a ` file ` containing the data and a ` state ` containing mapping information .
file
&File
state
&GuestMemoryState
track_dirty_pages
bool
file
&File
state
&GuestMemoryState
track_dirty_pages
bool