pub fn load_into(&self, destination: &mut [u8]) -> Result<(), usize> {
        if self.mem_size == 0 {
            return Ok(());
        }

        assert!(self.data.len() <= self.mem_size);

        if destination.len() < self.mem_size {
            Err(self.mem_size - destination.len())
        } else {
            copy_memory(self.data, destination);

            zero_memory(&mut destination[self.data.len()..self.mem_size]);

            Ok(())
        }
    }
/// Copy the data referenced by the program header into the destination
/// buffer. The buffer must be large enough to fit the entire `mem_size`
/// specified by the header, or `Err` will be returned with the difference.
///
/// # Panics
///
/// Panics if the `mem_size` is less than the length of the `data`, unless
/// `mem_size` is zero (in which case nothing is loaded and `Ok` is
/// returned).
Copy the data referenced by the program header into the destination
buffer. The buffer must be large enough to fit the entire `mem_size`
specified by the header, or `Err` will be returned with the difference.
Copy the data referenced by the program header into the destination buffer . The buffer must be large enough to fit the entire ` mem_size ` specified by the header or ` Err ` will be returned with the difference .
pub fn load_into(&self, destination: &mut [u8]) -> Result<(), usize> {
        if self.mem_size == 0 {
            return Ok(());
        }
        assert!(self.data.len() <= self.mem_size);
        if destination.len() < self.mem_size {
            Err(self.mem_size - destination.len())
        } else {
            copy_memory(self.data, destination);
            zero_memory(&mut destination[self.data.len()..self.mem_size]);
            Ok(())
        }
    }
pub fn load_into ( & self , destination : & mut [ u8 ] ) -> Result < ( ) , usize > { if self . mem_size == 0 { return Ok ( ( ) ) ; } assert ! ( self data len ( ) self mem_size ) ; if destination . len ( ) < self . mem_size { Err ( self . mem_size - destination . len ( ) ) } else { copy_memory ( self . data , destination ) ; zero_memory ( & mut destination [ self . data . len ( ) .. self . mem_size ] ) ; Ok ( ( ) ) } }
Copy the data referenced by the program header into the destination
buffer.
Copy the data referenced by the program header into the destination buffer .
&self
destination
&mut [u8]
panics
Panics if the `mem_size` is less than the length of the `data`, unless
`mem_size` is zero (in which case nothing is loaded and `Ok` is
returned).
Panics if the ` mem_size ` is less than the length of the ` data ` unless ` mem_size ` is zero ( in which case nothing is loaded and ` Ok ` is returned ) .