/// Writes the memory of the simulator in hexadecimal format.
///
/// # Examples
///
/// ```
/// use ibcm::Simulator;
///
/// let mut output = Vec::new();
/// {
///     let sim = Simulator::from_instructions(&[0x1000, 0x1800, 0x0000]).unwrap();
///     sim.to_hex(&mut output).unwrap();
/// }
/// let expected = b"1000
/// 1800
/// 0000
/// ";
///
/// assert_eq!(expected, output.as_slice());
/// ```
Writes the memory of the simulator in hexadecimal format.
Writes the memory of the simulator in hexadecimal format .
pub fn to_hex<W: Write>(&self, input: W) -> Result<()> {
        let mut bw = BufWriter::new(input);
        // Output the hex file
        for w in &self.memory[..self.len] {
            writeln!(bw, "{:04x}", w).chain_err(|| ErrorKind::Io("could not write to file".into()))?;
        }
        Ok(())
    }
pub fn to_hex < W : Write > ( & self , input : W ) -> Result < ( ) > { let mut bw = BufWriter :: new ( input ) ; // Output the hex file for w in & self . memory [ .. self . len ] { writeln ! ( bw " " w ) . chain_err ( | | ErrorKind :: Io ( " " . into ( ) ) ) ? ; } Ok ( ( ) ) }
Writes the memory of the simulator in hexadecimal format.
Writes the memory of the simulator in hexadecimal format .
&self
input
W
examples
```
use ibcm::Simulator.



assert_eq!(expected, output.as_slice());
```
` ` ` use ibcm :: Simulator . assert_eq! ( expected output . as_slice () ) ; ` ` `